OcrStatusAlerterPresenter extends BasePresenter<OcrStatusAlerterView> { @Override public void unsubscribe() { view.displayOcrStatus(UiIndicator.idle()); super.unsubscribe(); } @Inject  OcrStatusAlerterPresenter(@NonNull OcrStatusAlerterView view, @NonNull Context context, @NonNull OcrManager ocrManager); @Override void subscribe(); @Override void unsubscribe();  }
@Test public void unsubscribeEmitsAnIdleEventButIgnoresTheRest() { presenter.unsubscribe(); verify(view, times(2)).displayOcrStatus(UiIndicator.idle()); ocrProcessingStatusEvents.onNext(OcrProcessingStatus.UploadingImage); ocrProcessingStatusEvents.onNext(OcrProcessingStatus.PerformingScan); ocrProcessingStatusEvents.onNext(OcrProcessingStatus.RetrievingResults); verifyNoMoreInteractions(view); }