@Test public void test_getFiles__file_not_found() { String rootPath = path + "notFound/"; File root = new File(rootPath); Set<File> files = new HashSet<>(); Set<File> actualFiles = processor.getFiles(root, files); assertThat(actualFiles.isEmpty(), is(true)); }
protected Set<File> getFiles(File file, Set<File> files) { if (file.isFile()) { files.add(file); } else if (file.isDirectory()) { File[] filesInFolder = file.listFiles(); for (File fileInFolder : filesInFolder) { getFiles(fileInFolder, files); } } return files; }
Analyzer { protected Set<File> getFiles(File file, Set<File> files) { if (file.isFile()) { files.add(file); } else if (file.isDirectory()) { File[] filesInFolder = file.listFiles(); for (File fileInFolder : filesInFolder) { getFiles(fileInFolder, files); } } return files; } }
Analyzer { protected Set<File> getFiles(File file, Set<File> files) { if (file.isFile()) { files.add(file); } else if (file.isDirectory()) { File[] filesInFolder = file.listFiles(); for (File fileInFolder : filesInFolder) { getFiles(fileInFolder, files); } } return files; }  }
Analyzer { protected Set<File> getFiles(File file, Set<File> files) { if (file.isFile()) { files.add(file); } else if (file.isDirectory()) { File[] filesInFolder = file.listFiles(); for (File fileInFolder : filesInFolder) { getFiles(fileInFolder, files); } } return files; }  AnalyzerResult analyze(List<String> filePaths); }
Analyzer { protected Set<File> getFiles(File file, Set<File> files) { if (file.isFile()) { files.add(file); } else if (file.isDirectory()) { File[] filesInFolder = file.listFiles(); for (File fileInFolder : filesInFolder) { getFiles(fileInFolder, files); } } return files; }  AnalyzerResult analyze(List<String> filePaths);  }