// todo: already registered a SimpleModule here......what do vendors do who already define one?
final SimpleModule module = new SimpleModule();
module.addSerializer(CustomId.class, new CustomId.CustomIdJacksonSerializer());
module.addDeserializer(CustomId.class, new CustomId.CustomIdJacksonDeserializer());
final GraphWriter writer = GraphSONWriter.build()
.embedTypes(true)
.customModule(module).create();
try (final ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
writer.writeGraph(baos, g);
final JsonNode jsonGraph = new ObjectMapper().readTree(baos.toByteArray());
final JsonNode onlyVertex = jsonGraph.findValues(GraphSONTokens.VERTICES).get(0).get(0);
final JsonNode idValue = onlyVertex.get(GraphSONTokens.ID);
assertTrue(idValue.has("cluster"));