### Question:
BooleanParser implements ConfigurationParser { @Override public Boolean parseValue(String value, Class targetType) { if(value == null) throw new ConfigurationParserException("Could not parse 'null' to boolean"); Set<String> trueSet = new HashSet<>(Arrays.asList("1", "true", "yes")); value = value.toLowerCase(); return trueSet.contains(value); }  @Override Set<Class> getResponsibleClasses(); @Override Boolean parseValue(String value, Class targetType);  }### Answer:
@Test public void parseValue() { assertEquals(Boolean.TRUE, parser.parseValue("1", Boolean.class)); assertEquals(Boolean.TRUE, parser.parseValue("yes", Boolean.class)); assertEquals(Boolean.TRUE, parser.parseValue("true", Boolean.class)); assertEquals(Boolean.FALSE, parser.parseValue("asfdsdgf", Boolean.class)); assertEquals(Boolean.FALSE, parser.parseValue("", Boolean.class)); }
@Test(expected = ConfigurationParserException.class) public void parseNull() { parser.parseValue(null, Boolean.class); fail(); }