@Override
    protected boolean filter(Traverser.Admin<S> traverser) {
        final S s = traverser.get();
        if (s instanceof Element) {
            final Element toRemove = (Element) s;
            EventUtil.registerElementRemoval(callbackRegistry, getTraversal(), toRemove);
            toRemove.remove();
        } else if (s instanceof Property) {
            final Property toRemove = (Property) s;
            EventUtil.registerPropertyRemoval(callbackRegistry, getTraversal(), toRemove);
            toRemove.remove();
        } else
            throw new IllegalStateException("The incoming object is not removable: " + s);
        return false;
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DropStep.java