### Question:
ToPrintStream implements Destination { @Override @SneakyThrows public void write(final @NonNull Text line) { this.out.println(line.asString()); } ToPrintStream(final @NonNull PrintStream out); @Override @SneakyThrows void write(final @NonNull Text line);  }### Answer:
@Test(expected = NullPointerException.class) @SuppressWarnings("ConstantConditions") public void writeDoesNotAllowNull() { new ToPrintStream( new FakePrintStream() ).write(null); }
@Test public void everyWrittenLineEndsWithALineEnding() { new ToPrintStream( this.out ).write(new TextOf("")); Assertions.assertThat( this.out.lines() ).contains(System.lineSeparator()); }
@Test @SuppressWarnings("PMD.AvoidDuplicateLiterals") public void linesAreWrittenInOrder() { final var destination = new ToPrintStream(this.out); destination.write(new TextOf("Some Text")); destination.write(new TextOf("Another Text")); destination.write(new TextOf("For Good Measure")); Assertions.assertThat( this.out.lines() ).containsExactly( String.format("Some Text%s", System.lineSeparator()), String.format("Another Text%s", System.lineSeparator()), String.format("For Good Measure%s", System.lineSeparator()) ); }