public static ReferenceEdge detach(final Edge edge) {
        return edge instanceof ReferenceEdge ? (ReferenceEdge) edge : new ReferenceEdge(edge);
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceFactory.java