public static <S, E> boolean test(final Traverser.Admin<S> traverser, final Traversal.Admin<S, E> traversal) {
        prepare(traverser, traversal);
        final boolean val =  traversal.hasNext(); // filter

        //Close the traversal to release any underlying resources.
        CloseableIterator.closeIterator(traversal);

        return val;
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalUtil.java