### Question:
MutableTree implements Cloneable { public MutableTree getChild(String path) throws IllegalArgumentException { return getChild(NodeRef.split(path)); } private  MutableTree(String name); private  MutableTree(Node node); @Override String toString(); @Override boolean equals(Object o); static MutableTree createFromRefs(final ObjectId rootId,
            final Supplier<Iterator<NodeRef>> refs); static MutableTree createFromRefs(final ObjectId rootId,
            @Nullable final NodeRef... treeRefs); static MutableTree createFromRefs(final ObjectId rootId,
            final Iterator<NodeRef> treeRefs); static MutableTree createFromPaths(final ObjectId rootId,
            final Map<String, NodeRef> entries); Node getNode(); void forceChild(final String parentPath, final Node treeNode); void setChild(String parentPath, Node node); void setChild(final List<String> parentPath, final Node node); MutableTree getChild(String path); MutableTree getChild(final List<String> path); SortedMap<String, MutableTree> getChildrenAsMap(); @Nullable MutableTree removeChild(String path); void setNode(final Node newNode); RevTree build(ObjectStore store); @Override MutableTree clone(); static final Ordering<NodeRef> DEEPEST_LAST_COMPARATOR; static final Ordering<NodeRef> DEEPEST_FIRST_COMPARATOR; }### Answer:
@Test public void testGetChild() { assertNode(root.getChild("roads"), id("a1"), null, "roads"); assertNode(root.getChild("roads/highways"), id("a2"), id("d1"), "highways"); assertNode(root.getChild("roads/streets"), id("a3"), id("d2"), "streets"); assertNode(root.getChild("roads").getChild("highways"), id("a2"), id("d1"), "highways"); assertNode(root.getChild("buildings"), id("a4"), null, "buildings"); assertNode(root.getChild("buildings/stores"), id("a5"), id("d3"), "stores"); assertNode(root.getChild("buildings/unknown"), id("a6"), id("d4"), "unknown"); assertNode(root.getChild("buildings").getChild("unknown"), id("a6"), id("d4"), "unknown"); }
@Test public void testGetChildPreconditions() { try { assertNode(root.getChild(""), NULL, null, ROOT); fail("expected IAE on empty path"); } catch (IllegalArgumentException e) { assertTrue(true); } try { assertNull(root.getChild("notAChild")); fail("expected IAE on invalid child name"); } catch (IllegalArgumentException e) { assertTrue(true); } try { assertNull(root.getChild("not/a/child")); fail("expected IAE on invalid child name"); } catch (IllegalArgumentException e) { assertTrue(true); } }