YAML { public void write(Map<String, Object> mapping) { try (var writer = writer()) { writer.append("# This file was generated at " + LocalDateTime.now().format(ISO_DATE_TIME) + " using " + name + " 4.6.0 \n") .append(dump.dumpToString(mapping)); } catch (IOException e) { handle(e); } } YAML(String name); static YAML fromFile(String project, File file); void write(Map<String, Object> mapping);  }
@Test void write() throws IOException { yaml.write(Map.of("k", "v")); verify(yaml.writer, times(2)).append(any(CharSequence.class)); verify(yaml.writer).append("k: v\n"); }