### Question:
SharedPreferencesUtils { public void setBooleanPreference(String preference, boolean value) { Application application = (Application) firebaseApp.getApplicationContext(); SharedPreferences.Editor preferencesEditor = application.getSharedPreferences(PREFERENCES_PACKAGE_NAME, Context.MODE_PRIVATE).edit(); preferencesEditor.putBoolean(preference, value); preferencesEditor.apply(); } @Inject  SharedPreferencesUtils(FirebaseApp firebaseApp); void setBooleanPreference(String preference, boolean value); void clearPreference(String preference); boolean getAndSetBooleanPreference(String preference, boolean defaultValue); boolean getBooleanPreference(String preference, boolean defaultValue); boolean isPreferenceSet(String preference); boolean isManifestSet(String preference); boolean getBooleanManifestValue(String preference, boolean defaultValue);  }### Answer:
@Test public void setBooleanPreference_correctlySetsPreference() throws Exception { sharedPreferencesUtils.setBooleanPreference(TEST_PREFERENCE, false); verify(editor).putBoolean(TEST_PREFERENCE, false); verify(editor).apply(); }