@Test
    public void shouldConstructDetachedEdgeFromParts() {
        final Map<String, Object> properties = new HashMap<>();
        properties.put("x", "a");
        properties.put("y", "b");

        final DetachedEdge de = new DetachedEdge(10, "bought", properties, 1, "person", 2, "product");

        assertEquals(10, de.id());
        assertEquals("bought", de.label());
        assertEquals("person", de.vertices(Direction.OUT).next().label());
        assertEquals(1, de.vertices(Direction.OUT).next().id());
        assertEquals("product", de.vertices(Direction.IN).next().label());
        assertEquals(2, de.vertices(Direction.IN).next().id());

        assertEquals("a", de.properties("x").next().value());
        assertEquals(1, IteratorUtils.count(de.properties("x")));

        assertEquals("a", de.property("x").value());
        assertEquals("x", de.property("x").key());

        assertEquals("b", de.property("y").value());
        assertEquals("y", de.property("y").key());
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedEdgeTest.java