code: public static <T> List<T> toList(Enumeration<T> self) {
          List<T> answer = new ArrayList<T>();
          while (self.hasMoreElements()) {
              answer.add(self.nextElement());
          }
          return answer;
      }
docs: Convert an enumeration to a List.
  
  @param self an enumeration
  @return a List
  @since 1.5.0