SimpleFileScanner { @Nonnull public Set<File> scan(File rootDirectory, boolean recursive) { return scan(rootDirectory, recursive, TrueFileFilter.INSTANCE); } protected  SimpleFileScanner(); @Nonnull Set<File> scan(File rootDirectory, boolean recursive); @Nonnull Set<File> scan(File rootDirectory, boolean recursive, IOFileFilter ioFileFilter); final static SimpleFileScanner INSTANCE; }
@Test public void testScan() { File jarHome = new File(SystemUtils.JAVA_HOME); Set<File> directories = simpleFileScanner.scan(jarHome, true, DirectoryFileFilter.INSTANCE); Assert.assertFalse(directories.isEmpty()); directories = simpleFileScanner.scan(jarHome, false, new NameFileFilter("bin")); Assert.assertEquals(1, directories.size()); }