private String asString(final Iterator itty) {
        final StringBuilder sb = new StringBuilder().append("[");

        while (itty.hasNext()) {
            sb.append(argAsString(itty.next()));
            if (itty.hasNext())
                sb.append(",");
        }

        return sb.append("]").toString();
    }
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