@Override
    protected Set<?> map(final Traverser.Admin<S> traverser) {
        final Set setA = convertTraverserToSet(traverser);
        final Collection setB = (null != valueTraversal) ? convertTraversalToCollection(traverser, this.valueTraversal) : convertArgumentToCollection(parameterItems.get());
        final Set intersection = new HashSet();

        for (Object element : setB) {
            if (setA.contains(element)) {
                intersection.add(element);
            }
        }

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