@Override
    public Void visitTraversalStrategy(final GremlinParser.TraversalStrategyContext ctx) {
        if (ctx.getChildCount() == 1)
            sb.append(ctx.getText()).append(".instance()");
        else {
            visit(ctx.classType());
            sb.append(".build()");

            final List<ParseTree> configs = ctx.children.stream().
                    filter(c -> c instanceof GremlinParser.ConfigurationContext).collect(Collectors.toList());

            if (configs.size() > 0 && ctx.getChild(1).getText().equals(OptionsStrategy.class.getSimpleName())) {
                for (int ix = 0; ix < configs.size(); ix++) {
                    sb.append(".with(\"");
                    sb.append(configs.get(ix).getChild(0).getText());
                    sb.append("\", ");
                    visit(configs.get(ix).getChild(2));
                    sb.append(")");
                }
            } else {
                // the rest are the arguments to the strategy
                for (ParseTree config : configs) {
                    sb.append(".");
                    visit(config);
                }
            }

            sb.append(".create()");
        }

        return null;
    }
Converts a Gremlin traversal string into a Java source code representation of that traversal with an aim at
sacrificing some formatting for the ability to compile correctly.
<ul>
    <li>Range syntax has no direct support</li>
    <li>Normalizes whitespace</li>
    <li>Normalize numeric suffixes to lower case</li>
    <li>If floats are not suffixed they will translate as BigDecimal</li>
    <li>Makes anonymous traversals explicit with double underscore</li>
    <li>Makes enums explicit with their proper name</li>
</ul>
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java