@Test public void testContains() { final SharedPreferences mockPreferences = mock(SharedPreferences.class); final SharedPreferencesWrapper wrapper = new SharedPreferencesWrapper(mockPreferences); wrapper.contains(PREF_KEY); verify(mockPreferences).contains(PREF_KEY); verifyNoMoreInteractions(mockPreferences); }
@Override public boolean contains(@NonNull final String key) { return preferences.contains(key); }
SharedPreferencesWrapper implements SharedPreferences { @Override public boolean contains(@NonNull final String key) { return preferences.contains(key); } }
SharedPreferencesWrapper implements SharedPreferences { @Override public boolean contains(@NonNull final String key) { return preferences.contains(key); } SharedPreferencesWrapper(@NonNull final SharedPreferences preferences); }
SharedPreferencesWrapper implements SharedPreferences { @Override public boolean contains(@NonNull final String key) { return preferences.contains(key); } SharedPreferencesWrapper(@NonNull final SharedPreferences preferences); @NonNull final SharedPreferences getWrappedPreferences(); @Override void registerOnSharedPreferenceChangeListener(@NonNull final OnSharedPreferenceChangeListener listener); @Override void unregisterOnSharedPreferenceChangeListener(@NonNull final OnSharedPreferenceChangeListener listener); @Override Map<String, ?> getAll(); @Override boolean contains(@NonNull final String key); @Override @Nullable String getString(@NonNull final String key, @Nullable final String defValue); @Override @Nullable Set<String> getStringSet(@NonNull final String key, @Nullable final Set<String> defValues); @Override int getInt(@NonNull final String key, final int defValue); @Override long getLong(@NonNull final String key, final long defValue); @Override float getFloat(@NonNull final String key, final float defValue); @Override boolean getBoolean(@NonNull final String key, final boolean defValue); @Override @NonNull Editor edit(); }
SharedPreferencesWrapper implements SharedPreferences { @Override public boolean contains(@NonNull final String key) { return preferences.contains(key); } SharedPreferencesWrapper(@NonNull final SharedPreferences preferences); @NonNull final SharedPreferences getWrappedPreferences(); @Override void registerOnSharedPreferenceChangeListener(@NonNull final OnSharedPreferenceChangeListener listener); @Override void unregisterOnSharedPreferenceChangeListener(@NonNull final OnSharedPreferenceChangeListener listener); @Override Map<String, ?> getAll(); @Override boolean contains(@NonNull final String key); @Override @Nullable String getString(@NonNull final String key, @Nullable final String defValue); @Override @Nullable Set<String> getStringSet(@NonNull final String key, @Nullable final Set<String> defValues); @Override int getInt(@NonNull final String key, final int defValue); @Override long getLong(@NonNull final String key, final long defValue); @Override float getFloat(@NonNull final String key, final float defValue); @Override boolean getBoolean(@NonNull final String key, final boolean defValue); @Override @NonNull Editor edit();  }