Preferences { public boolean isLocaleCleaned() { return sharedPreferences.getBoolean(LOCALE_CLEANED, false); } Preferences(Context context); boolean isLocaleCleaned(); void saveLocaleCleaned();  }
@Test public void ShouldReturnFalseAsDefault_WhenAskedIfLocaleWasCleared() throws Exception { assertThat(preferences.isLocaleCleaned()).isFalse(); }
@Test public void ShouldReturnSavedValue_WhenLocaleIsClearedAsked() throws Exception { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(RuntimeEnvironment.application); sharedPreferences.edit().putBoolean(Preferences.LOCALE_CLEANED, true).apply(); assertThat(preferences.isLocaleCleaned()).isTrue(); }