@Test
    public void shouldHandlePath() throws Exception {
        final Vertex v = new DetachedVertex(123L, "person", Arrays.asList(
                DetachedVertexProperty.build().setId(1).setLabel("name").setValue("alice").create(),
                DetachedVertexProperty.build().setId(1).setLabel("age").setValue("31").create()));
        final Path p = ImmutablePath.make().extend(v, new HashSet<>(Collections.singletonList("a"))).
                extend(123L, new HashSet<>(Collections.singletonList("b"))).
                extend("alice", new HashSet<>(Collections.singletonList("c")));
        final String json = mapper.writeValueAsString(p);

        if (version.startsWith("v1") || version.startsWith("v3"))
            assertEquals("{\"labels\":[[\"a\"],[\"b\"],[\"c\"]],\"objects\":[{\"id\":123,\"label\":\"person\",\"type\":\"vertex\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"alice\"}],\"age\":[{\"id\":1,\"value\":\"31\"}]}},123,\"alice\"]}", json);
        else if (version.startsWith("v4"))
            assertEquals("{\"labels\":[[\"a\"],[\"b\"],[\"c\"]],\"objects\":[{\"id\":123,\"label\":[\"person\"],\"type\":\"vertex\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"alice\"}],\"age\":[{\"id\":1,\"value\":\"31\"}]}},123,\"alice\"]}", json);
        else
            assertEquals("{\"labels\":[[\"a\"],[\"b\"],[\"c\"]],\"objects\":[{\"id\":123,\"label\":\"person\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"alice\",\"label\":\"name\"}],\"age\":[{\"id\":1,\"value\":\"31\",\"label\":\"age\"}]}},123,\"alice\"]}", json);
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperTest.java