public static DetachedVertex detach(final Vertex vertex, final boolean withProperties) {
        // ComputerAdjacentVertex doesn't have properties, but we still want to detach them. force to false for
        // grabbing properties in this case.
        return vertex instanceof DetachedVertex ? (DetachedVertex) vertex :
                new DetachedVertex(vertex, withProperties && !(vertex instanceof ComputerGraph.ComputerAdjacentVertex));
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedFactory.java