MoreBundlePresenter implements Presenter { @VisibleForTesting public void handleAdClick() { view.getLifecycleEvent() .filter(lifecycleEvent -> lifecycleEvent.equals(View.LifecycleEvent.CREATE)) .flatMap(created -> view.adClicked() .map(AdHomeEvent::getAdClick) .map(adMapper::mapAdToSearchAd) .observeOn(viewScheduler) .doOnNext(result -> homeNavigator.navigateToAppView(result.getTag(), result.getSearchAdResult())) .retry()) .compose(view.bindUntilEvent(View.LifecycleEvent.DESTROY)) .subscribe(homeClick -> { }, throwable -> { throw new OnErrorNotImplementedException(throwable); }); } MoreBundlePresenter(MoreBundleView view, MoreBundleManager moreBundleManager,
      Scheduler viewScheduler, CrashReport crashReporter, HomeNavigator homeNavigator,
      AdMapper adMapper, BundleEvent bundleEvent, HomeAnalytics homeAnalytics,
      ChipManager chipManager); @Override void present(); @VisibleForTesting void onCreateSetupToolbar(); @VisibleForTesting void onCreateLoadBundles(); @VisibleForTesting void handleAppClick(); @VisibleForTesting void handleAdClick(); @VisibleForTesting void handleMoreClick(); @VisibleForTesting void handleBundleScrolledRight(); @VisibleForTesting void handleBottomReached(); @VisibleForTesting void handlePullToRefresh(); @VisibleForTesting void handleRetryClick();  }
@Test public void adClicked_NavigateToAppView() { AdHomeEvent event = createAdHomeEvent(); presenter.handleAdClick(); lifecycleEvent.onNext(View.LifecycleEvent.CREATE); adClickEvent.onNext(event); verify(homeNavigator).navigateToAppView(any(), any()); }