@Test
public void stopWithCallbackStopsDispatcherThreadAndRunsCallback() {

  Runnable callback = mock(Runnable.class);
  lifecycle.stop(callback);
  verify(dispatcher).shutdown();
  verify(callback).run();
}