Java tutorial
//package com.java2s; import java.util.Enumeration; import java.util.Iterator; public class Main { public static <E> Enumeration<E> asEnumeration(final Iterator<E> iter) { return new Enumeration<E>() { @Override public boolean hasMoreElements() { return iter.hasNext(); } @Override public E nextElement() { return iter.next(); } }; } }