LoggingHook implements CommitHook, NodeStateDiff { @Override public boolean propertyDeleted(PropertyState before) { writer.accept("p- " + toString(before)); return true; } private  LoggingHook(final Consumer<String> writer); void enter(NodeState before, NodeState after); void leave(NodeState before, NodeState after); @Override boolean propertyAdded(PropertyState after); @Override boolean propertyChanged(PropertyState before, PropertyState after); @Override boolean propertyDeleted(PropertyState before); @Override boolean childNodeAdded(String name, NodeState after); @Override boolean childNodeChanged(String name, NodeState before, NodeState after); @Override boolean childNodeDeleted(String name, NodeState before); @NotNull @Override NodeState processCommit(NodeState before, NodeState after, CommitInfo info);  }
@Test public void testPropertyDeleted() throws Exception { assertCommitProduces( lines( "p+ a+string <STRING> = a+string", "n!" ), root -> root.setProperty("a string", "a string") ); assertCommitProduces( lines( "p- a+string <STRING> = a+string", "n!" ), root -> root.removeProperty("a string") ); }