@Test public void testGetLong() { final SharedPreferences mockPreferences = mock(SharedPreferences.class); final SharedPreferencesFacade facade = new SimpleSharedPreferencesFacade(mockPreferences); facade.getLong(PREF_KEY, 1000L); verify(mockPreferences).getLong(PREF_KEY, 1000L); verifyNoMoreInteractions(mockPreferences); }
@Override public long getLong(@NonNull final String key, final long defValue) { return preferences.getLong(key, defValue); }
SimpleSharedPreferencesFacade implements SharedPreferencesFacade { @Override public long getLong(@NonNull final String key, final long defValue) { return preferences.getLong(key, defValue); } }
SimpleSharedPreferencesFacade implements SharedPreferencesFacade { @Override public long getLong(@NonNull final String key, final long defValue) { return preferences.getLong(key, defValue); } SimpleSharedPreferencesFacade(@NonNull final SharedPreferences preferences); }
SimpleSharedPreferencesFacade implements SharedPreferencesFacade { @Override public long getLong(@NonNull final String key, final long defValue) { return preferences.getLong(key, defValue); } SimpleSharedPreferencesFacade(@NonNull final SharedPreferences preferences); @NonNull final SharedPreferences getPreferences(); @Override void registerOnSharedPreferenceChangeListener(@NonNull final SharedPreferences.OnSharedPreferenceChangeListener listener); @Override void unregisterOnSharedPreferenceChangeListener(@NonNull final SharedPreferences.OnSharedPreferenceChangeListener listener); @Override boolean contains(@NonNull final String key); @Override boolean putString(@NonNull final String key, @Nullable final String value); @Override @Nullable String getString(@NonNull final String key, @Nullable final String defValue); @Override boolean putStringSet(@NonNull final String key, @Nullable final Set<String> values); @Override @Nullable Set<String> getStringSet(@NonNull final String key, @Nullable final Set<String> defValues); @Override boolean putInt(@NonNull final String key, final int value); @Override int getInt(@NonNull final String key, final int defValue); @Override boolean putFloat(@NonNull final String key, final float value); @Override float getFloat(@NonNull final String key, final float defValue); @Override boolean putLong(@NonNull final String key, final long value); @Override long getLong(@NonNull final String key, final long defValue); @Override boolean putBoolean(@NonNull final String key, final boolean value); @Override boolean getBoolean(@NonNull final String key, final boolean defValue); @Override boolean remove(@NonNull final String key); @Override int removeAll(); }
SimpleSharedPreferencesFacade implements SharedPreferencesFacade { @Override public long getLong(@NonNull final String key, final long defValue) { return preferences.getLong(key, defValue); } SimpleSharedPreferencesFacade(@NonNull final SharedPreferences preferences); @NonNull final SharedPreferences getPreferences(); @Override void registerOnSharedPreferenceChangeListener(@NonNull final SharedPreferences.OnSharedPreferenceChangeListener listener); @Override void unregisterOnSharedPreferenceChangeListener(@NonNull final SharedPreferences.OnSharedPreferenceChangeListener listener); @Override boolean contains(@NonNull final String key); @Override boolean putString(@NonNull final String key, @Nullable final String value); @Override @Nullable String getString(@NonNull final String key, @Nullable final String defValue); @Override boolean putStringSet(@NonNull final String key, @Nullable final Set<String> values); @Override @Nullable Set<String> getStringSet(@NonNull final String key, @Nullable final Set<String> defValues); @Override boolean putInt(@NonNull final String key, final int value); @Override int getInt(@NonNull final String key, final int defValue); @Override boolean putFloat(@NonNull final String key, final float value); @Override float getFloat(@NonNull final String key, final float defValue); @Override boolean putLong(@NonNull final String key, final long value); @Override long getLong(@NonNull final String key, final long defValue); @Override boolean putBoolean(@NonNull final String key, final boolean value); @Override boolean getBoolean(@NonNull final String key, final boolean defValue); @Override boolean remove(@NonNull final String key); @Override int removeAll();  }