### Question:
FileTool { public static void writeMinimalJson(final Path file, final String errorTemplate) { try { Files.write(file, MINIMAL_JSON); } catch (final IOException e) { throw buildError(file, errorTemplate, e); } } private  FileTool(); static void ensureDirectoryExists(final Path file, final String errorTemplate); static void writeMinimalJson(final Path file, final String errorTemplate); static void writeAsJson(final Path file, final Object v, final String errorTemplate); static T readFromJson(final Class<T> beanClass, final Path file, final String errorTemplate);  }### Answer:
@Test public void testWriteMinimalJsonFailure() { assertThrows(SantaException.class, () -> FileTool.writeMinimalJson(subDirectory, ERROR_TEMPLATE)); }
@Test public void testWriteMinimalJsonSuccess() throws Exception { FileTool.writeMinimalJson(newFile, ERROR_TEMPLATE); List<String> result = Files.readAllLines(newFile); List<String> expected = List.of("{}"); assertEquals(expected, result); }
@Test public void testWriteMinimalJsonFailure() { assertThrows(VocabHunterException.class, () -> FileTool.writeMinimalJson(subDirectory, ERROR_TEMPLATE)); }