### Question:
FileLocator { public void findFile() { logger.info("Searching in... {}", scanIn); File file = createFile(scanIn); search(file); }  void findFile();  }### Answer:
@Test public void testFindFile_for_a_single_file() { when(mockFile.isDirectory()).thenReturn(false); instance.findFile(); assertEquals(1, count); verify(mockFile, never()).listFiles(); }
@Test public void testFindFile_for_a_multiple_files() { when(mockFile.isDirectory()).thenReturn(true).thenReturn(false); when(mockFile.listFiles()).thenReturn(fileList()); instance.findFile(); assertEquals(2, count); }