FileCallbackThrottleByTime implements FileCallbackThrottle { @Override public void stopUpdates() { if (callback != null) { callback.onUpdate(downloadBatchStatus); } actionScheduler.cancelAll(); } FileCallbackThrottleByTime(ActionScheduler actionScheduler); @Override void setCallback(final DownloadBatchStatusCallback callback); @Override void update(DownloadBatchStatus downloadBatchStatus); @Override void stopUpdates();  }
@Test public void cancelsAllScheduledActions_whenStoppingUpdates() { callbackThrottleByTime.stopUpdates(); verify(actionScheduler).cancelAll(); }
@Test public void doesNotEmitLastStatus_whenCallbackAbsent() { callbackThrottleByTime.stopUpdates(); verifyZeroInteractions(callback); }