@Test
    @LoadGraphWith(MODERN)
    public void g_V_hasLabelXsoftwareX_connectedComponent_project_byXnameX_byXcomponentX() {
        final Traversal<Vertex, Map<String,Object>> traversal = get_g_V_hasLabelXsoftwareX_connectedComponent_project_byXnameX_byXcomponentX();
        printTraversalForm(traversal);
        int counter = 0;

        String softwareComponent = null;

        while (traversal.hasNext()) {
            final Map<String,Object> m = traversal.next();
            final String name = m.get("name").toString();

            // since the two returned values are in the same component just need to grab the first one and use that
            // as a comparison to the other
            if (null == softwareComponent)
                softwareComponent = m.get("component").toString();

            assertNotNull(softwareComponent);

            switch (name) {
                case "lop":
                case "ripple":
                    counter++;
                    assertEquals(softwareComponent, m.get("component"));
                    break;
            }
        }
        assertEquals(2, counter);
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ConnectedComponentTest.java