@Override
    public Object clone() {
        if (!isTxMode) {
            final TinkerVertex vertex = new TinkerVertex(id, label, graph, currentVersion);
            vertex.inEdgesId = inEdgesId;
            vertex.outEdgesId = outEdgesId;
            vertex.properties = properties;
            return vertex;
        }

        final TinkerVertex vertex = new TinkerVertex(id, label, graph, currentVersion);
        if (inEdgesId != null)
            vertex.inEdgesId = CollectionUtil.clone((ConcurrentHashMap<String, Set<Object>>) inEdgesId);

        if (outEdgesId != null)
            vertex.outEdgesId = CollectionUtil.clone((ConcurrentHashMap<String, Set<Object>>) outEdgesId);

        if (properties != null) {
            final ConcurrentHashMap<String, List<VertexProperty>> result = new ConcurrentHashMap<>(properties.size());

            // clone will not work because TinkerVertexProperty contains link to Vertex
            for (Map.Entry<String, List<VertexProperty>> entry : properties.entrySet()) {
                final List<VertexProperty> clonedValue = entry.getValue().stream()
                        .map(vp ->((TinkerVertexProperty) vp).copy(vertex))
                        .collect(Collectors.toList());

                result.put(entry.getKey(), clonedValue);
            }
            vertex.properties = result;
        }

        return vertex;
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java