public static <S, E> Iterator<E> cast(final Iterator<S> iterator) {
        return map(iterator, s -> (E) s);
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java