MainActivityPresenter implements DialogInterface.OnClickListener { void storeTiming(String timing) { long millis = getMillis(timing); sharedPreferences.edit() .putLong(Constants.OVERLAY_DEACTIVATED_TIMESTAMP, System.currentTimeMillis()) .apply(); sharedPreferences.edit().putLong(Constants.OVERLAY_DEACTIVATED_MILLIS, millis).apply(); } @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 testStoreTiming() throws Exception { mainActivityPresenter.storeTiming("3 min"); assertNotSame(sharedPreferences.getLong(Constants.OVERLAY_DEACTIVATED_TIMESTAMP, -1L), -1L); assertNotSame(sharedPreferences.getLong(Constants.OVERLAY_DEACTIVATED_MILLIS, -1L), -1L); }