class HugeScriptTraversal<S, E> extends DefaultTraversal<S, E> {

    private static final long serialVersionUID = 4617322697747299673L;

    private final String script;
    private final String language;
    private final Map<String, Object> bindings;
    private final Map<String, String> aliases;

    private Object result;

    public HugeScriptTraversal(TraversalSource traversalSource, String language, String script,
                               Map<String, Object> bindings, Map<String, String> aliases) {
        this.graph = traversalSource.getGraph();
        this.language = language;
        this.script = script;
        this.bindings = bindings;
        this.aliases = aliases;
        this.result = null;
    }

    public Object result() {
        return this.result;
    }

    public String script() {
        return this.script;
    }

    @Override
    public void applyStrategies() throws IllegalStateException {<FILL_FUNCTION_BODY>}
}

        ScriptEngine engine = SingleGremlinScriptEngineManager.get(this.language);

        Bindings bindings = engine.createBindings();
        bindings.putAll(this.bindings);

        @SuppressWarnings("rawtypes")
        TraversalStrategy[] strategies = this.getStrategies().toList()
                                             .toArray(new TraversalStrategy[0]);
        GraphTraversalSource g = this.graph.traversal();
        if (strategies.length > 0) {
            g = g.withStrategies(strategies);
        }
        bindings.put("g", g);
        bindings.put("graph", this.graph);

        for (Map.Entry<String, String> entry : this.aliases.entrySet()) {
            Object value = bindings.get(entry.getValue());
            if (value == null) {
                throw new IllegalArgumentException(String.format("Invalid alias '%s':'%s'",
                                                                 entry.getKey(), entry.getValue()));
            }
            bindings.put(entry.getKey(), value);
        }

        try {
            Object result = engine.eval(this.script, bindings);

            if (result instanceof Admin) {
                @SuppressWarnings({"unchecked"})
                Admin<S, E> traversal = (Admin<S, E>) result;
                traversal.getSideEffects().mergeInto(this.sideEffects);
                traversal.getSteps().forEach(this::addStep);
                this.strategies = traversal.getStrategies();
            } else {
                this.result = result;
            }
            super.applyStrategies();
        } catch (ScriptException e) {
            throw new HugeException(e.getMessage(), e);
        }
    
<no_super_class>