public static <T> List<T> asJavaUtilCollection(Iterator<T> c) {
        final List<T> result = new ArrayList<>();

        while(c.hasNext()) {
            result.add(c.next());
        }

        return result;
    }
public static <T> List<T> asJavaUtilCollection(Iterator<T> c) {
        final List<T> result = new ArrayList<>();

        while(c.hasNext()) {
            result.add(c.next());
        }

        return result;
    }
public static < T > List < T > asJavaUtilCollection ( Iterator < T > c ) { final List < T > result = new ArrayList <> ( ) ; while ( c . hasNext ( ) ) { result . add ( c . next ( ) ) ; } return result ; }
Copies the elements from an <code>Iterator</code> into a <code>Collection</code>.
Copies the elements from an <code > Iterator< / code > into a <code > Collection< / code > .