@Test
    @LoadGraphWith(MODERN)
    public void g_EX11X_elementMap() {
        final Object edgeId = convertToEdgeId("josh", "created", "lop");
        final Traversal<Edge, Map<Object,Object>> traversal = get_g_EX11X_elementMap(edgeId);
        printTraversalForm(traversal);

        final Map<Object,Object> m = traversal.next();
        assertEquals(5, m.size());
        assertEquals(0.4d, m.get("weight"));
        assertEquals("created", m.get(label));
        assertEquals(edgeId, m.get(T.id));

        final Vertex vJosh = convertToVertex("josh");
        assertEquals(vJosh.id(), ((Map<Object,Object>) m.get(Direction.OUT)).get(T.id));

        if (!hasGraphComputerRequirement())
            assertEquals(vJosh.label(), ((Map<Object,Object>) m.get(Direction.OUT)).get(T.label));

        final Vertex vLop = convertToVertex("lop");
        assertEquals(vLop.id(), ((Map<Object,Object>) m.get(Direction.IN)).get(T.id));

        if (!hasGraphComputerRequirement())
            assertEquals(vLop.label(), ((Map<Object,Object>) m.get(Direction.IN)).get(T.label));

        assertThat(traversal.hasNext(), is(false));
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ElementMapTest.java