public default <S, E> Collection convertTraversalToCollection(final Traverser.Admin<S> traverser, final Traversal.Admin<S, E> traversal) {
        final Object array = TraversalUtil.apply(traverser, traversal);

        if (null == array) {
            throw new IllegalArgumentException(
                    String.format(
                            "Provided traversal argument for %s step must yield an iterable type, not null",
                            getStepName()));
        }

        final Collection input = asCollection(array);

        if (null == input) {
            throw new IllegalArgumentException(
                    String.format(
                            "Provided traversal argument for %s step must yield an iterable type, encountered %s",
                            getStepName(),
                            array.getClass()));
        }

        return input;
    }
Template method used for retrieving the implementing Step's name.

@return this step's name.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/ListFunction.java