AbstractRebaseDiff implements NodeStateDiff { protected abstract void deleteChangedNode(NodeBuilder builder, String name, NodeState before); protected  AbstractRebaseDiff(NodeBuilder builder); @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);  }
@Test public void deleteChangedNode() { NodeBuilder headBuilder = base.builder(); headBuilder.getChildNode("a").setChildNode("aa"); NodeState head = headBuilder.getNodeState(); NodeBuilder branchBuilder = base.builder(); branchBuilder.getChildNode("a").remove(); NodeState branch = branchBuilder.getNodeState(); RebaseDiff rebaseDiff = new RebaseDiff(head.builder()) { @Override protected void deleteChangedNode(NodeBuilder builder, String name, NodeState before) { assertEquals("a", name); resolve(); } }; branch.compareAgainstBaseState(base, rebaseDiff); assertTrue(rebaseDiff.isResolved()); }