CharacterTypeConverter implements TypeConverter<String, Character> { @Override public Character convert(final String value) { Utils.checkArgument(value != null, "Value to convert must not be null"); Utils.checkArgument(!value.isEmpty(), "Value to convert must not be empty"); return value.charAt(0); }  @Override Character convert(final String value);  }
@Test public void whenInputIsNotEmpty_ThenShouldReturnFirstCharacter() { assertThat(converter.convert("foo")).isEqualTo('f'); }