@Override
    public void add(final String key, final Object value) {
        if (this.phase.workerState())
            this.memory.add(key, value);
        else
            this.memory.set(key, this.sideEffects.getReducer(key).apply(this.memory.get(key), value));
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/MemoryTraversalSideEffects.java