### Question:
ToLog implements Destination { @Override @SneakyThrows public void write(final Text line) { this.log.info(line.asString()); } ToLog(final @NonNull Log log); @Override @SneakyThrows void write(final Text line);  }### Answer:
@Test(expected = NullPointerException.class) @SuppressWarnings("ConstantConditions") public void writeDoesNotAllowNull() { new ToLog( this.log ).write(null); }
@Test public void everyWrittenLineEndsWithALineEnding() { new ToLog( this.log ).write(new TextOf("")); Assertions.assertThat( this.log.lines() ).contains(""); }
@Test public void linesAreWrittenInOrder() { final var destination = new ToLog(this.log); destination.write(new TextOf("Some Text")); destination.write(new TextOf("Another Text")); destination.write(new TextOf("For Good Measure")); Assertions.assertThat( this.log.lines() ).containsExactly( "Some Text", "Another Text", "For Good Measure" ); }