public static DetachedPath detach(final Path path, final boolean withProperties) {
        return path instanceof DetachedPath ? (DetachedPath) path : new DetachedPath(path, withProperties);
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedFactory.java