Android examples for java.util:Iterator
iterable From Iterator
//package com.book2s; import java.util.Iterator; public class Main { public static void main(String[] argv) { Iterator iterator = java.util.Arrays.asList("asdf", "book2s.com") .iterator();/* w ww . j a va2s .co m*/ System.out.println(iterableFromIterator(iterator)); } public static <T> Iterable<T> iterableFromIterator( final Iterator<T> iterator) { return new Iterable<T>() { public Iterator<T> iterator() { return iterator; } }; } }