@Override
    protected void sideEffect(final Traverser.Admin<S> traverser) {
        final Map<E, Long> map = new HashMap<>(1);
        map.put(TraversalUtil.applyNullable(traverser, this.keyTraversal), traverser.bulk());
        this.getTraversal().getSideEffects().add(this.sideEffectKey, map);
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupCountSideEffectStep.java