@Override
    public Map<E, Long> projectTraverser(final Traverser.Admin<S> traverser) {
        final Map<E, Long> map = new HashMap<>(1);
        TraversalUtil.produce(traverser, this.keyTraversal).ifProductive(p -> map.put((E) p, traverser.bulk()));
        return map;
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroupCountStep.java