DoublePreference extends Preference<Double> { @Override public boolean exists() { return mStringPreference.exists(); } DoublePreference(final String name, final String key,
            @Nullable final Double defaultValue); @Override boolean exists(); @Nullable @Override Double get();  }
@Test public void testExists() throws Exception { assertFalse(mNullPref.exists()); mNullPref.set(5D); assertTrue(mNullPref.exists()); mNullPref.set((Double) null); assertFalse(mNullPref.exists()); mNullPref.delete(); assertFalse(mNullPref.exists()); assertTrue(mTwoPref.exists()); mTwoPref.set(Double.MIN_VALUE); assertTrue(mTwoPref.exists()); mTwoPref.set(Double.MAX_VALUE); assertTrue(mTwoPref.exists()); mTwoPref.delete(); assertTrue(mTwoPref.exists()); }