FloatTypeConverter implements TypeConverter<String, Float> { @Override public Float 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 Double.valueOf(value).floatValue(); }  @Override Float convert(final String value);  }
@Test public void whenInputIsLegalValue_ThenShouldReturnFloat() { assertThat(converter.convert("5")).isEqualTo(5F); assertThat(converter.convert("5.0")).isEqualTo(5F); }