@Override
    protected List<List<?>> map(Traverser.Admin<S> traverser) {
        final Collection listA = convertTraverserToCollection(traverser);
        final Collection listB = (null != valueTraversal) ? convertTraversalToCollection(traverser, valueTraversal) : convertArgumentToCollection(parameterItems.get());
        final List elements = new ArrayList();

        for (Object elementInA : listA) {
            for (Object elementInB : listB) {
                final List pair = new ArrayList(2);
                pair.add(elementInA);
                pair.add(elementInB);
                elements.add(pair);
            }
        }

        return elements;
    }
A map step that returns the cartesian product of the traverser and the provided arguments.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProductStep.java