private Traversal parseGremlin(final String script) {
        // tests the normalizer by running the script from the feature file first
        final String normalizedGremlin = GremlinTranslator.translate(script, Translator.LANGUAGE).getTranslated();

        // parse the Gremlin to a Traversal
        final GremlinLexer lexer = new GremlinLexer(CharStreams.fromString(normalizedGremlin));
        final GremlinParser parser = new GremlinParser(new CommonTokenStream(lexer));
        final GremlinParser.QueryContext ctx = parser.query();

        // when parameters are used literally, they are converted to string representations that can be recognized by
        // the grammar and parsed inline. when they are used as variables, they are converted to objects that can be
        // applied to the script as variables.
        if (world.useParametersLiterally())
            return (Traversal) new GremlinAntlrToJava(g).visitQuery(ctx);
        else
            return (Traversal) new GremlinAntlrToJava(g, new VariableResolver.DefaultVariableResolver(this.stringParameters)).visitQuery(ctx);
    }
Some implementations of {@link VertexProperty} are not {@code Serializable} and may lead to test failures when passed as
parameters. One such instance is {@code HadoopVertexProperty}. This method detaches vertex properties as tests
should never require implementation-specific elements.
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/StepDefinition.java