@Override
    public void add(final String key, final Object value) {
        this.checkKeyValue(key, value);
        if (this.memoryMap.containsKey(key)) {
            final Object newValue = this.memoryComputeKeys.get(key).getReducer().apply(this.memoryMap.get(key), value);
            this.memoryMap.put(key, newValue);
        } else {
            this.memoryMap.put(key, value);
        }
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/MapMemory.java