### Question:
ColorSetting extends Setting<Integer> { @Override public Integer read(String string) throws InvalidConfigException { try { Integer integer = Integer.decode(string); if (integer.intValue() > 0xffffff || integer.intValue() < 0) { throw new InvalidConfigException("Color must have 6 hexadecimal digits"); } return integer; } catch (NumberFormatException e) { throw new InvalidConfigException("Invalid color " + string); } } ColorSetting(String name, String defaultValue); @Override Integer getDefaultValue(); @Override Integer read(String string); @Override String write(Integer value);  }### Answer:
@Test(expected = InvalidConfigException.class) public void testTooHigh() throws InvalidConfigException { ColorSetting setting = new ColorSetting("TestSetting", "0xffffff"); setting.read("0x1000000"); }
@Test(expected = InvalidConfigException.class) public void testNegative() throws InvalidConfigException { ColorSetting setting = new ColorSetting("TestSetting", "0xffffff"); setting.read("-1"); }