try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
writer.writeVertex(os, v1);
final AtomicBoolean called = 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, detachedVertex -> {
assertEquals(v1.id(), detachedVertex.id());
assertEquals(v1.label(), detachedVertex.label());
assertEquals(1, StreamFactory.stream(detachedVertex.iterators().hiddenPropertyIterator()).count());
assertEquals(1, StreamFactory.stream(detachedVertex.iterators().propertyIterator()).count());
assertEquals(v1.value("name"), detachedVertex.value("name").toString());