### Question:
TreeModelUtils { public static TreeItem prepareTreeModel(File homeFolder, TreeModelFilter filter) { return prepareTreeModel(homeFolder, filter, new FileFilter() { @Override public boolean accept(File pathname) { return pathname.isDirectory(); } }); }  static TreeItem prepareTreeModel(File homeFolder, TreeModelFilter filter); static TreeItem prepareTreeModel(File homeFolder, TreeModelFilter filter, FileFilter fileFilter);  }### Answer:
@Test public void testModel() { TreeItem model = TreeModelUtils.prepareTreeModel(FileTreeTest.testDir(), null); Assert.assertNotNull(model); Assert.assertTrue(model.getChildren().size() == FileTreeTest.H_NAMES.length); for (TreeItem item : model.getChildren()) { List<TreeItem> children = item.getChildren(); Assert.assertTrue(children.size() == FileTreeTest.SM_NAMES.length); } }
@Test public void testModelFilter() { TreeItem model = TreeModelUtils.prepareTreeModel(FileTreeTest.testDir(), new TreeModelFilter() { @Override public boolean accept(File file) { if (file.getName().toLowerCase().equals("a")) return false; else return true; } }); Assert.assertNotNull(model); Assert.assertTrue(model.getChildren().size() == FileTreeTest.H_NAMES.length-1); for (TreeItem item : model.getChildren()) { List<TreeItem> children = item.getChildren(); Assert.assertTrue(children.size() == FileTreeTest.SM_NAMES.length-1); } }