### Question:
CharParser implements ConfigurationParser { @Override public Character parseValue(String value, Class targetType) { if(value == null) throw new ConfigurationParserException("Could not parse 'null' to char"); if(value.length() != 1) throw new ConfigurationParserException("value must contain only one character"); return value.charAt(0); }  @Override Set<Class> getResponsibleClasses(); @Override Character parseValue(String value, Class targetType);  }### Answer:
@Test public void parseValue() { assertEquals('2', parser.parseValue("2", Character.class)); assertEquals('ä', parser.parseValue("ä", Character.class)); assertEquals('l', parser.parseValue("l", Character.class)); }
@Test(expected = ConfigurationParserException.class) public void parseNull() { parser.parseValue(null, Character.class); fail(); }
@Test(expected = ConfigurationParserException.class) public void parseToLongString() { parser.parseValue("tooManyChars", Character.class); fail(); }