YAML { protected abstract void handle(IOException e); YAML(String name); static YAML fromFile(String project, File file); void write(Map<String, Object> mapping);  }
@Test void handle() throws IOException { doThrow(IOException.class).when(yaml).writer(); yaml.write(Map.of()); verify(yaml).handle(any(IOException.class)); }
@Test void handle() { assertTrue(assertThrows(UncheckedIOException.class, () -> yaml.handle(exception)).getCause() instanceof IOException); }