public static < T > Iterable < T > iterable ( Enumeration < T > enumeration ) { LinkedList < T > list = new LinkedList <> ( ) ; while ( enumeration . hasMoreElements ( ) ) list . add ( enumeration . nextElement ( ) ) ; return list ; }
Create an Iterable from the enumeration by filling a LinkedList with the elements in the enumeration .