### Question:
StatsCallback extends ResultCallbackTemplate<StatsCallback, Statistics> { @Override public void onNext(Statistics stats) { if (stats != null) { this.stats = stats; this.onComplete(); } this.countDownLatch.countDown(); } StatsCallback(CountDownLatch countDownLatch); Statistics getStats(); @Override void onNext(Statistics stats); boolean gotStats(); void reset();  }### Answer:
@Test public void testOnNext() { statsCallback.onNext(statistics); assertEquals(statistics, statsCallback.getStats()); }