Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Enumeration; import java.util.Iterator; public class Main { public static <T> Iterator<T> iterator(Enumeration<T> enumeration) { return new Iterator<T>() { @Override public boolean hasNext() { return enumeration.hasMoreElements(); } @Override public T next() { return enumeration.nextElement(); } }; } }