MainActivityPresenter implements DialogInterface.OnClickListener { public void onTimingClick(String timing) { sharedPreferences.edit().putBoolean(Constants.APP_LOCK_ACTIVATED, false).apply(); storeTiming(timing); mainActivityView.showToast(Constants.OVERLAY_DEACTIVATED_MESSAGE); restoreToDefault(); launchHomeScreen(); } @Inject  MainActivityPresenter(Set<String> activatedPackages, SharedPreferences sharedPreferences,
      Context context, AccessibilityChecker accessibilityChecker); void setView(MainActivityView mainActivityView); void checkAccessibilityEnabled(); void onAppLockActivateClick(); void onTimingClick(String timing); void onWarningTextClick(); void onCreditTextClick(); void onGithubClick(); @Override void onClick(DialogInterface dialog, int which);  }
@Test public void testOnTimingClick() throws Exception { mainActivityPresenter.onTimingClick("3 min"); verify(mainActivityView).showToast(Constants.OVERLAY_DEACTIVATED_MESSAGE); verify(mainActivityView).launchActivity(Utils.getHomeScreenIntent()); verify(mainActivityView).hideTimingGrid(); verify(mainActivityView).showActivateButton(); verify(mainActivityView).showActivateHeader(); }