private static void setDarkModeEnabled(Context context, boolean value) {
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
    preferences.edit().putBoolean(AuthenticatorActivity.KEY_DARK_MODE_ENABLED, value).commit();
  }
Set the preference for key KEY_DARK_MODE_ENABLED of {@link AuthenticatorActivity}.
javatests/com/google/android/apps/authenticator/AuthenticatorActivityTest.java