public static ProgramPhase getMemorySideEffectsPhase(final Traversal.Admin<?, ?> traversal) {
        return traversal.getSideEffects() instanceof MemoryTraversalSideEffects ?
                ((MemoryTraversalSideEffects)traversal.getSideEffects()).phase:null;
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/MemoryTraversalSideEffects.java