public default Traversal.Admin<S, V> convertValueTraversal(final Traversal.Admin<S, V> valueTraversal) {
        if (valueTraversal instanceof ValueTraversal ||
                valueTraversal instanceof TokenTraversal ||
                valueTraversal instanceof IdentityTraversal ||
                valueTraversal instanceof ColumnTraversal ||
                valueTraversal.getStartStep() instanceof LambdaMapStep && ((LambdaMapStep) valueTraversal.getStartStep()).getMapFunction() instanceof FunctionTraverser) {
            return (Traversal.Admin<S, V>) __.map(valueTraversal).fold();
        } else
            return valueTraversal;
    }
Determines the first non-local {@link Barrier} step in the provided traversal. This method is used by {@link GroupStep}
and {@link GroupSideEffectStep} to ultimately determine the reducing bi-operator.

@param traversal The traversal to inspect.
@return The first non-local barrier step or {@code null} if no such step was found.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Grouping.java