public static void iterate(final Iterator iterator) {
        while (iterator.hasNext()) {
            iterator.next();
        }
        CloseableIterator.closeIterator(iterator);
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java