MoreBundlePresenter implements Presenter { @VisibleForTesting public void handleBundleScrolledRight() { view.getLifecycleEvent() .filter(lifecycleEvent -> lifecycleEvent.equals(View.LifecycleEvent.CREATE)) .flatMap(created -> view.bundleScrolled() .doOnNext(click -> homeAnalytics.sendScrollRightInteractEvent(click.getBundlePosition(), click.getBundle() .getTag(), click.getBundle() .getContent() .size())) .doOnError(crashReporter::log) .retry()) .compose(view.bindUntilEvent(View.LifecycleEvent.DESTROY)) .subscribe(scroll -> { }, 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 onBundleScrolledRight_SendScrollEvent() { presenter.handleBundleScrolledRight(); lifecycleEvent.onNext(View.LifecycleEvent.CREATE); bundleScrolledEvent.onNext(new HomeEvent(localTopAppsBundle, 2, HomeEvent.Type.SCROLL_RIGHT)); verify(homeAnalytics).sendScrollRightInteractEvent(2, localTopAppsBundle.getTag(), localTopAppsBundle.getContent() .size()); }