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