FileCallbackThrottleByProgressIncrease implements FileCallbackThrottle { @Override public void update(DownloadBatchStatus currentDownloadBatchStatus) { if (callback == null) { Logger.w("A DownloadBatchStatusCallback must be set before an update is called."); return; } if (progressHasChanged(currentDownloadBatchStatus)) { currentProgress = currentDownloadBatchStatus.percentageDownloaded(); callback.onUpdate(currentDownloadBatchStatus); } }  @Override void setCallback(DownloadBatchStatusCallback callback); @Override void update(DownloadBatchStatus currentDownloadBatchStatus); @Override void stopUpdates();  }
@Test public void doesNothing_whenCallbackUnset() { callbackThrottleByProgressIncrease.update(percentageIncreasedStatus); then(downloadBatchCallback).should(never()).onUpdate(percentageIncreasedStatus); }