HomeContainerPresenter implements Presenter { @VisibleForTesting public void handleClickOnGamesChip() { view.getLifecycleEvent() .filter(event -> event.equals(View.LifecycleEvent.CREATE)) .flatMap(__ -> view.gamesChipClicked()) .doOnNext(isChecked -> { if (isChecked) { homeContainerNavigator.loadGamesHomeContent(); chipManager.setCurrentChip(ChipManager.Chip.GAMES); } else { homeContainerNavigator.loadMainHomeContent(); chipManager.setCurrentChip(null); } homeAnalytics.sendChipInteractEvent(ChipManager.Chip.GAMES.getName()); homeAnalytics.sendChipHomeInteractEvent(ChipManager.Chip.GAMES.getName()); }) .compose(view.bindUntilEvent(View.LifecycleEvent.DESTROY)) .subscribe(__ -> { }, err -> { throw new OnErrorNotImplementedException(err); }); } HomeContainerPresenter(HomeContainerView view, Scheduler viewScheduler,
      AptoideAccountManager accountManager, HomeContainerNavigator homeContainerNavigator,
      HomeNavigator homeNavigator, HomeAnalytics homeAnalytics, Home home,
      ChipManager chipManager); @Override void present(); @VisibleForTesting void loadMainHomeContent(); @VisibleForTesting void loadUserImage(); @VisibleForTesting void handleUserImageClick(); @VisibleForTesting void handlePromotionsClick(); @VisibleForTesting void checkForPromotionApps(); @VisibleForTesting void handleClickOnPromotionsDialogContinue(); @VisibleForTesting void handleClickOnPromotionsDialogCancel(); @VisibleForTesting void handleLoggedInAcceptTermsAndConditions(); @VisibleForTesting void handleTermsAndConditionsContinueClicked(); @VisibleForTesting void handleTermsAndConditionsLogOutClicked(); @VisibleForTesting void handleClickOnTermsAndConditions(); @VisibleForTesting void handleClickOnPrivacyPolicy(); @VisibleForTesting void handleClickOnGamesChip(); @VisibleForTesting void handleClickOnAppsChip();  }
@Test public void gamesChipIsNotChecked_handleClickOnGamesChipTest() { when(view.gamesChipClicked()).thenReturn(Observable.just(true)); presenter.handleClickOnGamesChip(); lifecycleEvent.onNext(View.LifecycleEvent.CREATE); verify(homeAnalytics).sendChipInteractEvent(ChipManager.Chip.GAMES.getName()); verify(homeAnalytics).sendChipHomeInteractEvent(ChipManager.Chip.GAMES.getName()); verify(homeContainerNavigator).loadGamesHomeContent(); }