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 ( ) ; } } ; }
Create an Iterator from an Enumeration .