### Question:
DoubleSetting extends Setting<Double> { @Override public Double read(String string) throws InvalidConfigException { return StringHelper.readDouble(string, minValue, maxValue); } DoubleSetting(String name, double defaultValue, double minValue, double maxValue); @Override Double getDefaultValue(); @Override Double read(String string);  }### Answer:
@Test public void testOutOfBoundsSetting() throws InvalidConfigException { double min = -1.1; double max = 1.1; assertEquals(max, new DoubleSetting("TestSetting", 0, min, max).read("2").doubleValue(), 0.0000001); assertEquals(min, new DoubleSetting("TestSetting", 0, min, max).read("-2").doubleValue(), 0.0000001); }
@Test(expected = InvalidConfigException.class) public void testInvalidSetting() throws InvalidConfigException { new DoubleSetting("TestSetting", 0, -1, 1).read("NotANumber"); }