### Question:
TreeDifference { public SortedMap<NodeRef, NodeRef> findRenames() { SortedMap<String, MutableTree> leftEntries = leftTree.getChildrenAsMap(); SortedMap<String, MutableTree> rightEntries = rightTree.getChildrenAsMap(); SortedMapDifference<String, MutableTree> difference; difference = difference(leftEntries, rightEntries); return findRenames(difference); } TreeDifference(MutableTree leftTree, MutableTree rightTree); static TreeDifference create(MutableTree leftTree, MutableTree rightTree); MutableTree getLeftTree(); MutableTree getRightTree(); TreeDifference inverse(); SortedMap<NodeRef, NodeRef> findRenames(); SortedSet<NodeRef> findNewTrees(); SortedSet<NodeRef> findDeletes(); SortedMap<NodeRef, NodeRef> findChanges(); Map<NodeRef, NodeRef> findPureMetadataChanges(); boolean areEqual();  }### Answer:
@Test public void testFindRenames() { Map<NodeRef, NodeRef> renames = treeDifference.findRenames(); assertNotNull(renames); assertEquals(1, renames.size()); Entry<NodeRef, NodeRef> e = renames.entrySet().iterator().next(); NodeRef oldRef = e.getKey(); NodeRef newRef = e.getValue(); assertEquals(tree("roads/streets", "a3", "d2"), oldRef); assertEquals(tree("roads/streetsRenamed", "a3", "d2"), newRef); }