@Test
    @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
    public void shouldAttachToVertex() {
        final Edge e = g.E(convertToEdgeId("josh", "created", "lop")).next();
        final Property toDetach = e.property("weight");
        final DetachedProperty<?> detachedProperty = DetachedFactory.detach(toDetach);
        final Property attached = detachedProperty.attach(Attachable.Method.get(e.outVertex()));

        assertEquals(toDetach, attached);
        assertFalse(attached instanceof DetachedProperty);
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedPropertyTest.java