@Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
    public void shouldAttachToVertex() {
        final Vertex v = graph.addVertex();
        final VertexProperty toDetach = v.property(VertexProperty.Cardinality.single, "test", "this");
        final DetachedVertexProperty<?> detached = DetachedFactory.detach(toDetach, true);
        final VertexProperty attached = detached.attach(Attachable.Method.get(v));

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