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