private <T>Collection<T> convert(Enumeration<T> iter){
  List<T> list=new ArrayList<>();
  while (iter.hasMoreElements())   list.add(iter.nextElement());
  return list;
}

private < T > Collection < T > convert ( Enumeration < T > iter ) { List < T > list = new ArrayList < > ( ) ; while ( iter . hasMoreElements ( ) ) list . add ( iter . nextElement ( ) ) ; return list ; }
convert data to collection .
