### Question:
FileTool { public static void writeAsJson(final Path file, final Object v, final String errorTemplate) { try { MAPPER.writeValue(file.toFile(), v); } 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 testWriteAsJsonWithError() { assertThrows(SantaException.class, () -> FileTool.writeAsJson(subDirectory, new FileToolTestBean(), ERROR_TEMPLATE)); }
@Test public void testWriteAsJsonWithError() { assertThrows(VocabHunterException.class, () -> FileTool.writeAsJson(subDirectory, new FileToolTestBean(), ERROR_TEMPLATE)); }