CollectStatTask implements Runnable { @Override public void run() { Stats stats = collector.collect(); StatMessage message = message(stats); appender.append(message); } CollectStatTask(LogAppender appender, StatCollector collector); @Override void run();  }
@Test void run() { task.run(); verify(appender).append(any(StatMessage.class)); }