LoggingHook implements CommitHook, NodeStateDiff { @Override public boolean childNodeChanged(String name, NodeState before, NodeState after) { writer.accept("n^ " + safeEncode(name)); this.enter(before, after); boolean ret = after.compareAgainstBaseState(before, this); this.leave(before, after); return ret; } 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 testChildNodeChanged() throws Exception { assertCommitProduces( lines( "n^ existing", "n+ child", "n!", "n!", "n!" ), root -> root.getChildNode("existing").setChildNode("child") ); }