@Test
        @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
        @org.junit.Ignore("TINKERPOP-1509")
        public void shouldSerializeTree() throws Exception {
            final ObjectMapper mapper = graph.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().version(GraphSONVersion.V3_0).create().createMapper();
            final Tree t = g.V(convertToVertexId("marko")).out().properties("name").tree().next();
            final String json = mapper.writeValueAsString(t);

            final HashMap<String, Object> m = (HashMap<String, Object>) mapper.readValue(json, mapTypeReference);

            // Check Structure
            assertEquals(1, m.size());
            assertTrue(m.containsKey(convertToVertexId("marko").toString()));

            // Check Structure n+1
            final HashMap<String, Object> branch = (HashMap<String, Object>) m.get(convertToVertexId("marko").toString());
            assertEquals(2, branch.size());
            assertTrue(branch.containsKey(GraphSONTokens.KEY));
            assertTrue(branch.containsKey(GraphSONTokens.VALUE));

            //Check n+1 key (traversed element)
            final HashMap<String, Object> branchKey = (HashMap<String, Object>) branch.get(GraphSONTokens.KEY);
            assertTrue(branchKey.containsKey(GraphSONTokens.ID));
            assertTrue(branchKey.containsKey(GraphSONTokens.LABEL));
            assertTrue(branchKey.containsKey(GraphSONTokens.TYPE));
            assertTrue(branchKey.containsKey(GraphSONTokens.PROPERTIES));
            assertEquals(convertToVertexId("marko").toString(), branchKey.get(GraphSONTokens.ID).toString());
            assertEquals("person", branchKey.get(GraphSONTokens.LABEL));
            assertEquals("vertex", branchKey.get(GraphSONTokens.TYPE));
            final HashMap<String, List<HashMap<String, Object>>> branchKeyProps = (HashMap<String, List<HashMap<String, Object>>>) branchKey.get(GraphSONTokens.PROPERTIES);
            assertEquals("marko", branchKeyProps.get("name").get(0).get("value"));
            assertEquals(29, branchKeyProps.get("age").get(0).get("value"));

            //Check n+1 value (traversed element)
            final HashMap<String, Object> branchValue = (HashMap<String, Object>) branch.get(GraphSONTokens.VALUE);
            assertEquals(3, branchValue.size());
            assertTrue(branchValue.containsKey(convertToVertexId("vadas").toString()));
            assertTrue(branchValue.containsKey(convertToVertexId("lop").toString()));
            assertTrue(branchValue.containsKey(convertToVertexId("josh").toString()));

            // Check that vp[] functioned properly
            final HashMap<String, HashMap<String, Object>> branch2 = (HashMap<String, HashMap<String, Object>>) branchValue.get(convertToVertexId("vadas").toString());
            assertTrue(branch2.containsKey(GraphSONTokens.KEY));
            assertTrue(branch2.containsKey(GraphSONTokens.VALUE));

            final Map.Entry entry = branch2.get(GraphSONTokens.VALUE).entrySet().iterator().next();
            final HashMap<String, HashMap<String, Object>> branch2Prop = (HashMap<String, HashMap<String, Object>>) entry.getValue();
            assertTrue(branch2Prop.get(GraphSONTokens.KEY).containsKey(GraphSONTokens.ID));
            assertTrue(branch2Prop.get(GraphSONTokens.KEY).containsKey(GraphSONTokens.VALUE));
            assertTrue(branch2Prop.get(GraphSONTokens.KEY).containsKey(GraphSONTokens.LABEL));
            assertEquals("name", branch2Prop.get(GraphSONTokens.KEY).get(GraphSONTokens.LABEL));
            assertEquals("vadas", branch2Prop.get(GraphSONTokens.KEY).get(GraphSONTokens.VALUE));
            assertEquals(entry.getKey().toString(), branch2Prop.get(GraphSONTokens.KEY).get(GraphSONTokens.ID).toString());
        }
Serialization tests that occur at a lower level than IO.  Note that there is no need to test GraphML here as
it is not a format that can be used for generalized serialization (i.e. it only serializes an entire graph).

@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java