Prefser { public boolean contains(String key) { return preferences.contains(key); } Prefser(@NonNull Context context);  Prefser(@NonNull Context context, @NonNull JsonConverter jsonConverter);  Prefser(@NonNull SharedPreferences sharedPreferences); @SuppressLint("CommitPrefEdits")  Prefser(@NonNull SharedPreferences sharedPreferences,
      @NonNull JsonConverter jsonConverter); SharedPreferences getPreferences(); boolean contains(String key); Observable<T> getAndObserve(String key, Class<T> classOfT, T defaultValue); Observable<T> getAndObserve(final String key, final TypeToken<T> typeTokenOfT,
      final T defaultValue); Observable<T> observe(@NonNull String key, @NonNull Class<T> classOfT,
      T defaultValue); Observable<T> observe(@NonNull final String key,
      @NonNull final TypeToken<T> typeTokenOfT, final T defaultValue); T get(@NonNull String key, @NonNull Class<T> classOfT, T defaultValue); T get(@NonNull String key, @NonNull TypeToken<T> typeTokenOfT, T defaultValue); Observable<String> observePreferences(); void put(@NonNull String key, @NonNull T value); void put(@NonNull String key, @NonNull T value, @NonNull TypeToken<T> typeTokenOfT); void remove(@NonNull String key); void clear(); int size();  }
@Test public void testContains() throws Exception { prefser.clear(); String givenValue = GIVEN_STRING_VALUE; String givenKey = GIVEN_KEY; prefser.put(givenKey, givenValue); assertThat(prefser.contains(givenKey)).isTrue(); prefser.remove(givenKey); assertThat(prefser.contains(givenKey)).isFalse(); }