private String asParameter(final Object arg) {
        final String paramName = String.format("_%d", paramCount.getAndIncrement());
        // todo: consider resetting paramCount when it's larger then 1_000_000
        parameters.put(paramName, arg);
        return paramName;
    }
This class helps to build a gremlin-lang compatible string representation based on a {@link TraversalSource}
and then a {@link Traversal}.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/GremlinLang.java