PreferenceDataStore { public boolean isSet(@NonNull String key) { return getPreference(key).get() != null; } @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)  PreferenceDataStore(@NonNull Context context);   PreferenceDataStore(@NonNull Context context, @NonNull UrbanAirshipResolver resolver); void addListener(@NonNull PreferenceChangeListener listener); void removeListener(@NonNull PreferenceChangeListener listener); boolean isSet(@NonNull String key); boolean getBoolean(@NonNull String key, boolean defaultValue); @SuppressLint("UnknownNullness") String getString(@NonNull String key, String defaultValue); long getLong(@NonNull String key, long defaultValue); int getInt(@NonNull String key, int defaultValue); @NonNull JsonValue getJsonValue(@NonNull String key); void remove(@NonNull String key); void put(@NonNull String key, @Nullable String value); void put(@NonNull String key, long value); void put(@NonNull String key, int value); void put(@NonNull String key, boolean value); void put(@NonNull String key, @Nullable JsonValue value); void put(@NonNull String key, @Nullable JsonSerializable value); boolean putSync(@NonNull String key, @Nullable String value);  }
@Test public void testIsSet() { assertFalse(testPrefs.isSet("neat")); testPrefs.put("neat", "oh hi"); assertTrue(testPrefs.isSet("neat")); testPrefs.remove("neat"); assertFalse(testPrefs.isSet("neat")); }