### Question:
CompiledJavaccFilesDirectory { public Collection<CompiledJavaccFile> listFiles() { Collection<File> files = FileUtils.listFiles(outputDirectory, TrueFileFilter.TRUE, TrueFileFilter.TRUE); Collection<CompiledJavaccFile> compiledJavaccFiles = new ArrayList<CompiledJavaccFile>(); for (File file : files) { CompiledJavaccFile compiledJavaccFile = new CompiledJavaccFile(file, outputDirectory, customAstClassesDirectory, targetDirectory, logger); compiledJavaccFiles.add(compiledJavaccFile); } return compiledJavaccFiles; } CompiledJavaccFilesDirectory(File outputDirectory, FileTree customAstClassesDirectory, File targetDirectory, Logger logger); Collection<CompiledJavaccFile> listFiles(); @Override String toString();  }### Answer:
@Test public void listFilesReturnsEmptyCollectionForEmptyDirectory() { CompiledJavaccFilesDirectory directory = new CompiledJavaccFilesDirectory(new File(getClass().getResource("/empty").getFile()), null, null, null); Collection<CompiledJavaccFile> files = directory.listFiles(); assertThat(files, is(empty())); }
@Test public void listFilesReturnsAllFiles() { CompiledJavaccFilesDirectory directory = new CompiledJavaccFilesDirectory(new File(getClass().getResource("/compiledResults").getFile()), null, null, null); Collection<CompiledJavaccFile> files = directory.listFiles(); final int numberOfFilesInFolder = 2; assertThat(files, hasSize(numberOfFilesInFolder)); }
@Test public void listFilesReturnsAllFilesRecursively() { CompiledJavaccFilesDirectory directory = new CompiledJavaccFilesDirectory(new File(getClass().getResource("/compiledResultsWithSubFolders").getFile()), null, null, null); Collection<CompiledJavaccFile> files = directory.listFiles(); final int numberOfFilesInFolder = 3; assertThat(files, hasSize(numberOfFilesInFolder)); }