### Question:
BooleanSetting extends Setting<Boolean> { @Override public Boolean read(String string) throws InvalidConfigException { if (string.equalsIgnoreCase("true")) { return Boolean.TRUE; } if (string.equalsIgnoreCase("false")) { return Boolean.FALSE; } throw new InvalidConfigException(string + " is not a boolean"); } BooleanSetting(String name, boolean defaultValue); @Override Boolean getDefaultValue(); @Override Boolean read(String string);  }### Answer:
@Test public void testValidValues() throws InvalidConfigException { BooleanSetting setting = setting(); setting.read("true"); setting.read("false"); setting.read("TRUE"); setting.read("True"); setting.read("FALSE"); setting.read("False"); }
@Test(expected = InvalidConfigException.class) public void testInvalidValue() throws InvalidConfigException { BooleanSetting setting = setting(); setting.read("invalid"); }