iterable interface in java
List<String> list = new ArrayList><();
list.add("one");
list.add("two");
list.add("three");
Iterator<String> iterator = list.iterator();
while(iterator.hasNext()) {
String element = iterator.next();
System.out.println( element );
}