@Override
    public Object visitTraversalTerminalMethod_toList(final GremlinParser.TraversalTerminalMethod_toListContext ctx) {
        final GremlinLang bc = this.traversal.asAdmin().getGremlinLang();
        bc.addStep("toList");
        return bc;
    }
{@inheritDoc}

Traversal terminal method to list step
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/TerminalMethodToBytecodeVisitor.java