### Question:
FileManager { public Set<File> listFilesInDirectory(final String directoryPath) { final File dir = new File(directory, directoryPath); return listFilesInDirectory(dir); } FileManager(final File rootDirectory); File createDirectory(final String directoryPath); File getDirectory(final String directoryPath); Set<File> listFilesInDirectory(final String directoryPath); Set<File> listFilesInDirectory(final File direc); File createFile(final String filepath); File createFile(final File file); boolean deleteFile(final String filepath); boolean deleteFile(final File file); InputStream newInputStream(final String filepath); InputStream newInputStream(final File file); OutputStream newOutputStream(final String filepath, final boolean append); OutputStream newOutputStream(final File file, final boolean append);  }### Answer:
@Test public void testListFilesInDirectoryFromPath() throws IOException { File subDirectory = new File(ROOT_DIRECTORY, SUB_DIRECTORY_PATH); assertFalse(subDirectory.exists()); subDirectory.mkdir(); File file1 = new File(subDirectory, FILE_PATH + "_1"); file1.createNewFile(); File file2 = new File(subDirectory, FILE_PATH + "_2"); file2.createNewFile(); File file3 = new File(subDirectory, FILE_PATH + "_3"); file3.createNewFile(); assertEquals(fileManager.listFilesInDirectory(SUB_DIRECTORY_PATH).size(), 3); assertTrue(file1.delete()); assertTrue(file2.delete()); assertTrue(file3.delete()); }
@Test public void testListFilesInDirectoryFromFile() throws IOException { File subDirectory = new File(ROOT_DIRECTORY, SUB_DIRECTORY_PATH); assertFalse(subDirectory.exists()); subDirectory.mkdir(); File file1 = new File(subDirectory, FILE_PATH + "_1"); file1.createNewFile(); File file2 = new File(subDirectory, FILE_PATH + "_2"); file2.createNewFile(); File file3 = new File(subDirectory, FILE_PATH + "_3"); file3.createNewFile(); assertEquals(fileManager.listFilesInDirectory(subDirectory).size(), 3); assertTrue(file1.delete()); assertTrue(file2.delete()); assertTrue(file3.delete()); }