### Question:
FileManager { void writeToFile(File file, String fileContent) { if (!file.exists()) { try { final FileWriter writer = new FileWriter(file); writer.write(fileContent); writer.close(); } catch (IOException e) { e.printStackTrace(); } } } @Inject  FileManager();   }### Answer:
@Test public void testWriteToFile() { File fileToWrite = createDummyFile(); String fileContent = "content"; fileManager.writeToFile(fileToWrite, fileContent); assertThat(fileToWrite.exists(), is(true)); }