@Test(timeout = TIMEOUT)
public void toString_of_commands_is_good_for_logging() {

    final StringBuilder loggerOutput = new StringBuilder();
    Executor loggingExecutor = wrappedCommand -> loggerOutput.append(wrappedCommand.toString());
    WorkerCounter counter = new WorkerCounter(loggingExecutor);
    Runnable originalCommand = mock(Runnable.class, "<the command's original toString>");
    counter.execute(originalCommand);
    assertThat(loggerOutput.toString(), containsString(originalCommand.toString()));
}