@Test
    @LoadGraphWith(MODERN)
    public void g_V_group_byXbothE_countX_byXgroup_byXlabelXX() {
        final Traversal<Vertex, Map<Long, Map<String, List<Vertex>>>> traversal = get_g_V_group_byXbothE_countX_byXgroup_byXlabelXX();
        printTraversalForm(traversal);
        final Map<Long, Map<String, List<Vertex>>> map = traversal.next();
        assertFalse(traversal.hasNext());
        assertEquals(2, map.size());
        assertTrue(map.containsKey(1l));
        assertTrue(map.containsKey(3l));
        //
        Map<String, List<Vertex>> submap = map.get(1l);
        assertEquals(2, submap.size());
        assertTrue(submap.containsKey("software"));
        assertTrue(submap.containsKey("person"));
        List<Vertex> list = submap.get("software");
        assertEquals(1, list.size());
        assertEquals(convertToVertex(graph, "ripple"), list.get(0));
        list = submap.get("person");
        assertEquals(2, list.size());
        assertTrue(list.contains(convertToVertex(graph, "vadas")));
        assertTrue(list.contains(convertToVertex(graph, "peter")));
        //
        submap = map.get(3l);
        assertEquals(2, submap.size());
        assertTrue(submap.containsKey("software"));
        assertTrue(submap.containsKey("person"));
        list = submap.get("software");
        assertEquals(1, list.size());
        assertEquals(convertToVertex(graph, "lop"), list.get(0));
        list = submap.get("person");
        assertEquals(2, list.size());
        assertTrue(list.contains(convertToVertex(graph, "marko")));
        assertTrue(list.contains(convertToVertex(graph, "josh")));
    }
@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/sideEffect/GroupTest.java