class SharedPreferencesUtils {

  public boolean getAndSetBooleanPreference(String preference, boolean defaultValue) {
    Application application = (Application) firebaseApp.getApplicationContext();
    SharedPreferences preferences =
        application.getSharedPreferences(PREFERENCES_PACKAGE_NAME, Context.MODE_PRIVATE);

    // Value set at runtime overrides anything else, but default to defaultValue.
    if (preferences.contains(preference)) {
      boolean result = preferences.getBoolean(preference, defaultValue);
      return result;
    }
    // No preferences set yet - use and set defaultValue.
    setBooleanPreference(preference, defaultValue);
    return defaultValue;
  }

  @Inject public  SharedPreferencesUtils(FirebaseApp firebaseApp);

}