### Question:
FileSystemModel implements TreeModel { @Override public Object getChild(final Object parent, final int index) { File directory = (File) parent; String[] children = directory.list(); return new TreeFile(directory, children[index]); } FileSystemModel(final File rootDirectory); @Override Object getRoot(); @Override Object getChild(final Object parent, final int index); @Override int getChildCount(final Object parent); @Override boolean isLeaf(final Object node); @Override int getIndexOfChild(final Object parent, final Object child); @Override void valueForPathChanged(final TreePath path, final Object value); @Override void addTreeModelListener(final TreeModelListener listener); @Override void removeTreeModelListener(final TreeModelListener listener);  }### Answer:
@Test public void testGetChild() { String testRoot = IRODS_TEST_SUBDIR_PATH + "/testGetRoot"; String childRoot = testRoot + "/hitherechild1"; String absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(testRoot); String otherDir = scratchFileUtils.createAndReturnAbsoluteScratchPath(childRoot); FileSystemModel instance = new FileSystemModel(new File(absPath)); Object expResult = new File(otherDir); Object result = instance.getChild(instance.getRoot(), 0); assertEquals(expResult, result); }