There are two JCR unit tests (part of the TCK unit test suite) that are deleting a subgraph and expecting the JCR implementation to produce NODE_REMOVED events for all nodes in the subgraph:
org.apache.jackrabbit.test.api.observation.NodeRemovedTest.testMultiNodesRemoved() line 70
org.apache.jackrabbit.test.api.observation.WorkspaceOperationTest.testCopy() line 54
While this was required in the JCR 1.0 specification, the JCR 2.0 specification allows for different behavior. From Section 12.2 of the JCR 2.0 specification:
"The scope of event reporting is implementation-dependent. An implementation should make a best-effort attempt to
report all events, but may exclude events if reporting them would be impractical given implementation or resource
limitations. For example, on an import, move or remove of a subgraph containing a large number of items, an
implementation may choose to report only events associated with the root node of the affected graph and not those
for every subitem in the structure."
In some implementations, producing NODE_REMOVED events for every node in the deleted subgraph require first reading this information from persistent storage to identify all of the nodes that are being removed. While this is often acceptable for small operations, doing this for even moderately-sized subgraphs can induce an unnecessary performance penalty on the remove operation.
Therefore, the JCR unit tests (i.e., the TCK tests) should not expect or require an implementation produce NODE_REMOVED events for all nodes in the subgraph, but per the specification should merely expect at least a single NODE_REMOVED event for the top node in the subgraph.