@Test
    @LoadGraphWith(MODERN)
    public void g_V_valueMap_withXtokensX() {
        for (final Traversal<Vertex, Map<Object, Object>> traversal :
                Arrays.asList(get_g_V_valueMapXtrueX(), get_g_V_valueMap_withXtokensX())) {
            printTraversalForm(traversal);
            int counter = 0;
            while (traversal.hasNext()) {
                counter++;
                final Map<Object, Object> values = traversal.next();
                final String name = (String) ((List) values.get("name")).get(0);
                assertEquals(4, values.size());
                assertThat(values.containsKey(T.id), is(true));
                if (name.equals("marko")) {
                    assertEquals(29, ((List) values.get("age")).get(0));
                    assertEquals("person", values.get(T.label));
                } else if (name.equals("josh")) {
                    assertEquals(32, ((List) values.get("age")).get(0));
                    assertEquals("person", values.get(T.label));
                } else if (name.equals("peter")) {
                    assertEquals(35, ((List) values.get("age")).get(0));
                    assertEquals("person", values.get(T.label));
                } else if (name.equals("vadas")) {
                    assertEquals(27, ((List) values.get("age")).get(0));
                    assertEquals("person", values.get(T.label));
                } else if (name.equals("lop")) {
                    assertEquals("java", ((List) values.get("lang")).get(0));
                    assertEquals("software", values.get(T.label));
                } else if (name.equals("ripple")) {
                    assertEquals("java", ((List) values.get("lang")).get(0));
                    assertEquals("software", values.get(T.label));
                } else {
                    throw new IllegalStateException("It is not possible to reach here: " + values);
                }
            }
            assertEquals(6, counter);
        }
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ValueMapTest.java