### Question:
ExportTreeManager { boolean isExportNeeded() { return !fileUtilsWrapper.getFile(buildExportFilePath(subDir)).exists(); } ExportTreeManager(String subDir);   ExportTreeManager(FileUtilsWrapper fileUtilsWrapper, String subDir);   }### Answer:
@Test public void isExportNeededTrue() { doReturn(externalRoot).when(fileUtilsWrapper).getCineLogRoot(); doReturn("/root/CineLog").when(externalRoot).getAbsolutePath(); File file = mock(File.class); String path = "/root/CineLog/saves/movie/export" + new SimpleDateFormat("yyyyMMdd").format(new Date()) + ".csv"; doReturn(file).when(fileUtilsWrapper).getFile(path); doReturn(false).when(file).exists(); assertTrue(new ExportTreeManager(fileUtilsWrapper, "movie").isExportNeeded()); }
@Test public void isExportNeededFalse() { doReturn(externalRoot).when(fileUtilsWrapper).getCineLogRoot(); doReturn("/root/CineLog").when(externalRoot).getAbsolutePath(); File file = mock(File.class); String path = "/root/CineLog/saves/movie/export" + new SimpleDateFormat("yyyyMMdd").format(new Date()) + ".csv"; doReturn(file).when(fileUtilsWrapper).getFile(path); doReturn(true).when(file).exists(); assertFalse(new ExportTreeManager(fileUtilsWrapper, "movie").isExportNeeded()); }