PreferenceStoreImpl implements PreferenceStore { @Override public SharedPreferences.Editor edit() { return sharedPreferences.edit(); } PreferenceStoreImpl(Context context, String name); @Override SharedPreferences get(); @Override SharedPreferences.Editor edit(); @Override boolean save(SharedPreferences.Editor editor);  }
@Test @SuppressLint("CommitPrefEdits") public void testEdit() { assertNotNull(preferenceStore.edit()); assertTrue(preferenceStore.edit() instanceof SharedPreferences.Editor); }