@Override
    public <R> R get(final String key) throws IllegalArgumentException {
        if (!this.previousMap.containsKey(key)) throw Memory.Exceptions.memoryDoesNotExist(key);

        final Optional<Object> o = this.previousMap.get(key);
        final R r = (R) o.orElse(null);
        if (this.inExecute && !this.memoryKeys.get(key).isBroadcast())
            throw Memory.Exceptions.memoryDoesNotExist(key);
        else
            return r;
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMemory.java