### Question:
FileSystemModel implements TreeModel { @Override public boolean isLeaf(final Object node) { if (node instanceof File) { File file = (File) node; return file.isFile(); } else { throw new IdropRuntimeException("unknown node type"); } } 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 testIsLeaf() throws Exception { String testRoot = IRODS_TEST_SUBDIR_PATH + "/testIsLeaf"; String testFileName = "atestfile.txt"; String absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(testRoot); String testFile = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 10); FileSystemModel instance = new FileSystemModel(new File(absPath)); Object result = instance.getChild(instance.getRoot(), 0); assertEquals(true, instance.isLeaf(result)); }