@Override
    public Traversal.Admin<S, E> apply(final Graph graph) {
        final Traversal.Admin<S, E> clone = this.traversal.clone();
        if (!clone.isLocked()) {
            clone.setGraph(graph);
            clone.applyStrategies();
        }
        return clone;
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalObjectFunction.java