@Test
    @LoadGraphWith(MODERN)
    public void g_V_hasXageX_propertiesXnameX() {
        final Traversal<Vertex, VertexProperty<String>> traversal = get_g_V_hasXageX_propertiesXnameX();
        printTraversalForm(traversal);
        final Set<String> keys = new HashSet<>();
        final Set<String> values = new HashSet<>();
        final Set<Object> ids = new HashSet<>();
        int counter = 0;
        while (traversal.hasNext()) {
            counter++;
            final VertexProperty<String> vertexProperty = traversal.next();
            keys.add(vertexProperty.key());
            values.add(vertexProperty.value());
            ids.add(vertexProperty.id());
            Object id = vertexProperty.id();
            id = id instanceof Number ? ((Number) id).longValue() : id;
            Object otherId = convertToVertex(graph, vertexProperty.value()).property("name").id();
            otherId = otherId instanceof Number ? ((Number) otherId).longValue() : otherId;
            assertEquals(otherId, id);
            assertEquals("name", vertexProperty.key());
            assertEquals(convertToVertex(graph, vertexProperty.value()).values("name").next(), vertexProperty.value());
            assertEquals(convertToVertex(graph, vertexProperty.value()).value("name"), vertexProperty.value());
        }
        assertEquals(4, counter);
        assertEquals(1, keys.size());
        assertTrue(keys.contains("name"));
        assertEquals(4, values.size());
        assertTrue(values.contains("marko"));
        assertTrue(values.contains("vadas"));
        assertTrue(values.contains("josh"));
        assertTrue(values.contains("peter"));
        assertEquals(4, ids.size());
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesTest.java