@Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
    public void shouldReferencePropertyOfVertexPropertyWhenRemoved() {
        final AtomicBoolean triggered = new AtomicBoolean(false);
        final Vertex v = graph.addVertex();
        final VertexProperty vp = v.property("xxx","blah");
        final String label = vp.label();
        final Object value = vp.value();
        final Property p = vp.property("to-drop", "dah");
        vp.property("not-dropped", "yay!");

        final MutationListener listener = new AbstractMutationListener() {
            @Override
            public void vertexPropertyPropertyRemoved(final VertexProperty element, final Property property) {
                assertThat(element, instanceOf(ReferenceVertexProperty.class));
                assertEquals(label, element.label());
                assertEquals(value, element.value());
                assertEquals("dah", property.value());
                assertEquals("to-drop", property.key());
                triggered.set(true);
            }
        };
        final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);

        if (graph.features().graph().supportsTransactions())
            builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));

        final EventStrategy eventStrategy = builder.create();
        final GraphTraversalSource gts = create(eventStrategy);

        gts.V(v).properties("xxx").properties("to-drop").drop().iterate();
        tryCommit(graph);

        assertEquals(1, IteratorUtils.count(g.V(v).properties()));
        assertEquals(1, IteratorUtils.count(g.V(v).properties().properties()));
        assertEquals("yay!", g.V(vp.element()).properties("xxx").values("not-dropped").next());
        assertThat(triggered.get(), is(true));
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java