Preferences { public void saveLocaleCleaned() { sharedPreferences.edit().putBoolean(LOCALE_CLEANED, true).apply(); } Preferences(Context context); boolean isLocaleCleaned(); void saveLocaleCleaned();  }
@Test public void ShouldSaveLocaleIsCleaned_WhenAsked() throws Exception { preferences.saveLocaleCleaned(); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(RuntimeEnvironment.application); assertThat(sharedPreferences).contains(Preferences.LOCALE_CLEANED, true); }