### Question:
VisualiserWriterFactory { public Writer create(String destination) throws IOException { String destinationFileName = outputFolder + File.separator + destination + ".dot"; System.err.println("CREATING VISUALISER WRITER with destinationFile=" + destinationFileName); return new OutputStreamWriter(new FileOutputStream(destinationFileName), StandardCharsets.UTF_8); } VisualiserWriterFactory(Path outputFolder); Writer create(String destination);  }### Answer:
@Test void create_validPath_expectSuccess() throws Exception { VisualiserWriterFactory writerFactory = new VisualiserWriterFactory(tempDir.toPath()); Writer result = writerFactory.create("destination"); assertNotNull(result); result.close(); }
@Test void create_invalidPath_expectFailure() { VisualiserWriterFactory writerFactory = new VisualiserWriterFactory(new File("madeUpBadPath").toPath()); assertThrows(FileNotFoundException.class, () -> writerFactory.create("destination")); }