BatchFileReader { public static List<Path> readPathsFromBatchFile(Path batchFile) { logger.info("Processing batch file {}", batchFile); try (Stream<String> lines = Files.lines(batchFile, Charset.defaultCharset())) { return lines .filter(commentLines()) .filter(emptyLines()) .map(line -> Paths.get(line.trim())) .collect(toList()); } catch (IOException ex) { logger.error("Unable to read batch file {}", batchFile, ex); } return Collections.emptyList(); } private  BatchFileReader(); static List<Path> readPathsFromBatchFile(Path batchFile);  }
@Test public void testReadPathsFromBatchFile() { assertThat(readPaths("src/test/resources/testBatchFiles.txt").size(), equalTo(3)); }