@Test
    public void shouldReadWritePath() throws Exception {
        final String resourceName = "traversal-path";

        final Path resource = findModelEntryObject(resourceName);
        final byte[] bytes = write(resource, Path.class, resourceName);
        final HashMap fromStatic = read(readFromResource(resourceName), HashMap.class);
        final HashMap recycled = read(bytes, HashMap.class);
        assertNotSame(fromStatic, recycled);
        assertEquals(resource.labels().size(), ((List) fromStatic.get("labels")).size());
        assertEquals(resource.labels().get(0).size(), ((List) ((List) fromStatic.get("labels")).get(0)).size());
        assertEquals(resource.labels().get(1).size(), ((List) ((List) fromStatic.get("labels")).get(1)).size());
        assertEquals(resource.labels().get(2).size(), ((List) ((List) fromStatic.get("labels")).get(2)).size());
        assertEquals(resource.objects().size(), ((List) fromStatic.get("objects")).size());
        assertEquals(((Vertex) resource.objects().get(0)).id(), ((Map) ((List) fromStatic.get("objects")).get(0)).get("id"));
        assertEquals(Collections.singletonList(((Vertex) resource.objects().get(0)).label()), ((Map) ((List) fromStatic.get("objects")).get(0)).get("label"));
        assertEquals(((Vertex) resource.objects().get(1)).id(), ((Map) ((List) fromStatic.get("objects")).get(1)).get("id"));
        assertEquals(Collections.singletonList(((Vertex) resource.objects().get(1)).label()), ((Map) ((List) fromStatic.get("objects")).get(1)).get("label"));
        assertEquals(((Vertex) resource.objects().get(2)).id(), ((Map) ((List) fromStatic.get("objects")).get(2)).get("id"));
        assertEquals(Collections.singletonList(((Vertex) resource.objects().get(2)).label()), ((Map) ((List) fromStatic.get("objects")).get(2)).get("label"));
        assertEquals(resource.labels().size(), ((List) recycled.get("labels")).size());
        assertEquals(resource.labels().get(0).size(), ((List) ((List) recycled.get("labels")).get(0)).size());
        assertEquals(resource.labels().get(1).size(), ((List) ((List) recycled.get("labels")).get(1)).size());
        assertEquals(resource.labels().get(2).size(), ((List) ((List) recycled.get("labels")).get(2)).size());
        assertEquals(resource.objects().size(), ((List) recycled.get("objects")).size());
        assertEquals(((Vertex) resource.objects().get(0)).id(), ((Map) ((List) recycled.get("objects")).get(0)).get("id"));
        assertEquals(Collections.singletonList(((Vertex) resource.objects().get(0)).label()), ((Map) ((List) recycled.get("objects")).get(0)).get("label"));
        assertEquals(((Vertex) resource.objects().get(1)).id(), ((Map) ((List) recycled.get("objects")).get(1)).get("id"));
        assertEquals(Collections.singletonList(((Vertex) resource.objects().get(1)).label()), ((Map) ((List) recycled.get("objects")).get(1)).get("label"));
        assertEquals(((Vertex) resource.objects().get(2)).id(), ((Map) ((List) recycled.get("objects")).get(2)).get("id"));
        assertEquals(Collections.singletonList(((Vertex) resource.objects().get(2)).label()), ((Map) ((List) recycled.get("objects")).get(2)).get("label"));
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-util/src/test/java/org/apache/tinkerpop/gremlin/structure/io/AbstractUntypedCompatibilityTest.java