DoublePreference extends Preference<Double> { @Nullable @Override public Double get() { if (contains()) { final String value = mStringPreference.get(); try { return Double.valueOf(value); } catch (final NumberFormatException e) { throw new RuntimeException("Error parsing DoublePreference's (" + getName() + ':' + getKey() + ") value: \"" + value + '"', e); } } else { return getDefaultValue(); } } DoublePreference(final String name, final String key,
            @Nullable final Double defaultValue); @Override boolean exists(); @Nullable @Override Double get();  }
@Test public void testGet() throws Exception { assertNull(mNullPref.get()); mNullPref.set(50D); assertTrue(mNullPref.get() == 50D); mNullPref.set(64D); assertTrue(mNullPref.get() == 64D); mNullPref.delete(); assertNull(mNullPref.get()); assertTrue(mTwoPref.get() == 2D); mTwoPref.set(Double.MIN_VALUE); assertTrue(mTwoPref.get() == Double.MIN_VALUE); mTwoPref.set(Double.MAX_VALUE); assertTrue(mTwoPref.get() == Double.MAX_VALUE); mTwoPref.delete(); assertTrue(mTwoPref.get() == 2D); }