@Override public List<T> getAsListAndClose() { LinkedList<T> list = new LinkedList<T>(); while ( hasNext() ) { list.add( next() ); } close(); return list; }
@Override public Collection<T> getAsCollectionAndClose( Collection<T> collection ) { while ( hasNext() ) { collection.add( next() ); } close(); return collection; } }