private static DetachedVertex detachVertex(final Vertex vertex) {
        return new DetachedVertex(vertex.id(), vertex.label(),
                (List<VertexProperty>) IteratorUtils.asList(vertex.properties()).stream()
                        .map(vp -> detachVertexProperty((VertexProperty) vp)).collect(Collectors.toList()));
    }
Some implementations of {@link Vertex} are not {@code Serializable} and may lead to test failures when passed as
parameters. One such instance is {@code HadoopVertex}. This method detaches vertices as tests should never
require implementation-specific elements.
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/StepDefinition.java