public static void registerElementRemoval(final CallbackRegistry<Event> callbackRegistry,
                                              final Traversal.Admin<Object, Object> traversal,
                                              final Element elementForRemoval){
        if (hasAnyCallbacks(callbackRegistry)) {
            final EventStrategy eventStrategy = forceGetEventStrategy(traversal);
            final Event removeEvent;
            if (elementForRemoval instanceof Vertex)
                removeEvent = new Event.VertexRemovedEvent(eventStrategy.detach((Vertex) elementForRemoval));
            else if (elementForRemoval instanceof Edge)
                removeEvent = new Event.EdgeRemovedEvent(eventStrategy.detach((Edge) elementForRemoval));
            else if (elementForRemoval instanceof VertexProperty)
                removeEvent = new Event.VertexPropertyRemovedEvent(eventStrategy.detach((VertexProperty) elementForRemoval));
            else
                throw new IllegalStateException("The incoming object is not removable: " + elementForRemoval);

            callbackRegistry.getCallbacks().forEach(c -> c.accept(removeEvent));
        }
    }
Register a vertex property addition event with the callback registry.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EventUtil.java