final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
writer.writeVertex(os, v1, Direction.OUT);
final AtomicBoolean calledVertex = new AtomicBoolean(false);
final AtomicBoolean calledEdge = new AtomicBoolean(false);
final KryoReader reader = KryoReader.build()
.custom(graphProvider.createConfiguredGremlinKryo())
.workingDirectory(File.separator + "tmp").create();
try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
reader.readVertex(bais, Direction.OUT, detachedVertex -> {
assertEquals(v1.id(), detachedVertex.id());
assertEquals(v1.label(), detachedVertex.label());
assertEquals(0, StreamFactory.stream(detachedVertex.iterators().hiddenPropertyIterator()).count());
assertEquals(1, StreamFactory.stream(detachedVertex.iterators().propertyIterator()).count());
assertEquals(v1.value("name"), detachedVertex.value("name").toString());