code: public static <T> ArrayList<T> list(Enumeration<T> e) {
          ArrayList<T> l = new ArrayList<>();
          while (e.hasMoreElements())
              l.add(e.nextElement());
          return l;
      }
docs: Returns an array list containing the elements returned by the
  specified enumeration in the order they are returned by the
  enumeration.  This method provides interoperability between
  legacy APIs that return enumerations and new APIs that require
  collections.
  
  @param <T> the class of the objects returned by the enumeration
  @param e enumeration providing elements for the returned
  array list
  @return an array list containing the elements returned
  by the specified enumeration.
  @since 1.4
  @see Enumeration
  @see ArrayList