@Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
    public void shouldAttachToGraph() {
        final Vertex v = graph.addVertex();
        final VertexProperty toReference = v.property(VertexProperty.Cardinality.single, "test", "this");
        final ReferenceVertexProperty<?> rvp = ReferenceFactory.detach(toReference);
        final VertexProperty referenced = rvp.attach(Attachable.Method.get(graph));

        assertEquals(toReference, referenced);
        assertFalse(referenced instanceof ReferenceVertexProperty);
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexPropertyTest.java