### Question:
CharacterConverter implements ParameterConverter<Character> { @Override public Character fromString(String input) throws IllegalArgumentException { if (input == null) { throw new NullPointerException("input must not be null"); } if (input.length() != 1) { throw new IllegalArgumentException("The input string \"" + input + "\" cannot be converted to a " + "character. The input's length must be 1"); } return input.toCharArray()[0]; } private  CharacterConverter(); @Override Character fromString(String input); @Override Class<Character> getType(); static final CharacterConverter INSTANCE; }### Answer:
@Test public void testFromString() throws Exception { assertThat(converter.fromString("a")).isEqualTo('a'); }
@Test(expected = NullPointerException.class) public void testWithNull() throws Exception { converter.fromString(null); }
@Test(expected = IllegalArgumentException.class) public void testWithEmptyString() throws Exception { converter.fromString(""); }
@Test(expected = IllegalArgumentException.class) public void testWithLongString() throws Exception { converter.fromString("ab"); }