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

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

        return differenceSet;
    }
A map step that returns the difference of the traverser and the provided arguments without duplicates.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/DifferenceStep.java