@Test public void remove_removesValueInSharedPrefsByKey() { when(sharedPreferencesEditor.remove(anyString())).thenReturn(sharedPreferencesEditor); PersistentStore.remove("key", context); InOrder inOrder = Mockito.inOrder(sharedPreferencesEditor); inOrder.verify(sharedPreferencesEditor).remove("key"); inOrder.verify(sharedPreferencesEditor).apply(); }
static void remove(String key, Context context) { Context applicationContext = context.getApplicationContext(); SharedPreferences sharedPreferences = applicationContext.getSharedPreferences(PREFERENCES_KEY, Context.MODE_PRIVATE); sharedPreferences.edit().remove(key).apply(); }
PersistentStore { static void remove(String key, Context context) { Context applicationContext = context.getApplicationContext(); SharedPreferences sharedPreferences = applicationContext.getSharedPreferences(PREFERENCES_KEY, Context.MODE_PRIVATE); sharedPreferences.edit().remove(key).apply(); } }
PersistentStore { static void remove(String key, Context context) { Context applicationContext = context.getApplicationContext(); SharedPreferences sharedPreferences = applicationContext.getSharedPreferences(PREFERENCES_KEY, Context.MODE_PRIVATE); sharedPreferences.edit().remove(key).apply(); }  }
PersistentStore { static void remove(String key, Context context) { Context applicationContext = context.getApplicationContext(); SharedPreferences sharedPreferences = applicationContext.getSharedPreferences(PREFERENCES_KEY, Context.MODE_PRIVATE); sharedPreferences.edit().remove(key).apply(); }   }
PersistentStore { static void remove(String key, Context context) { Context applicationContext = context.getApplicationContext(); SharedPreferences sharedPreferences = applicationContext.getSharedPreferences(PREFERENCES_KEY, Context.MODE_PRIVATE); sharedPreferences.edit().remove(key).apply(); }    }