### Question:
TreeDifference { public SortedSet<NodeRef> findNewTrees() { SortedMap<String, MutableTree> leftEntries = leftTree.getChildrenAsMap(); SortedMap<String, MutableTree> rightEntries = rightTree.getChildrenAsMap(); SortedMapDifference<String, MutableTree> difference; difference = difference(leftEntries, rightEntries); Map<String, MutableTree> entriesOnlyOnRight; entriesOnlyOnRight = newHashMap(difference.entriesOnlyOnRight()); Map<NodeRef, NodeRef> pureRenames = findRenames(difference); for (NodeRef renamedTo : pureRenames.values()) { entriesOnlyOnRight.remove(renamedTo.path()); } SortedSet<NodeRef> newTreeRefs = Sets.newTreeSet(); for (Map.Entry<String, MutableTree> newTree : entriesOnlyOnRight.entrySet()) { Node node = newTree.getValue().getNode(); String parentPath = NodeRef.parentPath(newTree.getKey()); ObjectId metadataId = ObjectId.NULL; NodeRef ref = new NodeRef(node, parentPath, metadataId); newTreeRefs.add(ref); } return newTreeRefs; } 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 testFindNewTrees() { Set<NodeRef> newTrees = treeDifference.findNewTrees(); assertEquals(4, newTrees.size()); assertTrue(newTrees.contains(tree("buildings/knownUnknown", "a61", "d41"))); assertTrue(newTrees.contains(tree("admin", "c1", "d5"))); assertTrue(newTrees.contains(tree("admin/area", "c2", "d6"))); assertTrue(newTrees.contains(tree("admin/line", "c3", "d7"))); }