@Override
    protected Set<E> map(final Traverser.Admin<S> traverser) {
        final Set<E> result = new LinkedHashSet<>();
        final Iterator itty = IteratorUtils.asIterator(traverser.get());
        while (itty.hasNext()) {
            result.add((E)itty.next());
        }
        return result;
    }
@author Daniel Kuppitz (http://gremlin.guru)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/DedupLocalStep.java