### Question:
GlossaryPrinter implements Printer { @Override public void print() { final var runnable = new Timed.TimedRunnable( () -> { this.info.write( new FormattedText( "Scanning %d java files for @Term annotation", this.directory.files().size() )); this.target.write( this.format.of( new FromCodebase( new FromFiles(this.directory) ) ).formatted() ); }); final Duration runtime = runnable.runtime(); this.info.write( new FormattedText("Finished in: %ss", runtime.toSeconds()) ); } GlossaryPrinter(
        final @NonNull Directory directory,
        final @NonNull Destination info,
        final @NonNull Destination target,
        final @NonNull Format format
    );  GlossaryPrinter(
        final Directory directory,
        final Destination output,
        final Format format
    ); @Override void print();  }### Answer:
@Test public void printsNumberOfFiles() { final var info = new FakeDestination(); new GlossaryPrinter( () -> new ListOf<File>(), info, new FakeDestination(), Format.PLAIN ).print(); Assertions.assertThat( info.lines() ).contains( "Scanning 0 java files for @Term annotation" + System.lineSeparator() ); }
@Test public void printsGlossaryToDestination() { final var destination = new FakeDestination(); new GlossaryPrinter( () -> new ListOf<File>(), new FakeDestination(), destination, Format.PLAIN ).print(); Assertions.assertThat( destination.lines() ).contains( "No definitions found." + System.lineSeparator() ); }
@Test public void printsFinished() { final var info = new FakeDestination(); new GlossaryPrinter( () -> new ListOf<File>(), info, new FakeDestination(), Format.PLAIN ).print(); Assertions.assertThat( info.lines() ).contains( "Finished in: 0s" + System.lineSeparator() ); }