public static <T extends DataObject>List<T> iteratorToList(Iterator<T> itr){
  List<T> objs=new ArrayList<T>();
  while (itr.hasNext()) {
    objs.add(itr.next());
  }
  return objs;
}

public static < T extends DataObject > List < T > iteratorToList ( Iterator < T > itr ) { List < T > objs = new ArrayList < T > ( ) ; while ( itr . hasNext ( ) ) { objs . add ( itr . next ( ) ) ; } return objs ; }
utility functions that returns the iterator entries as a list
