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

        if (setA.size() == 0) {
            return setB;
        } else if (setB.size() == 0) {
            return setA;
        } else {
            for (Object item : setA) {
                if (!setB.contains(item)) {
                    disjunctSet.add(item);
                }
            }

            for (Object item : setB) {
                if (!setA.contains(item)) {
                    disjunctSet.add(item);
                }
            }
        }

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