### Question:
FractionConverter implements CommandLine.ITypeConverter<Float> { @Override public Float convert(final String value) throws FractionConversionException { try { return Fraction.fromString(value).getValue(); } catch (final NullPointerException | IllegalArgumentException e) { throw new FractionConversionException(value); } }  @Override Float convert(final String value);  }### Answer:
@Test public void assertThatConvertHandlesProperlyAValidString() throws FractionConversionException { final float fraction = fractionConverter.convert("0.58"); assertThat(fraction).isNotNull(); assertThat(fraction).isEqualTo(0.58f); }
@Test public void assertThatConvertHandlesProperlyAnInvalidStringNotANumber() { final Throwable thrown = catchThrowable(() -> fractionConverter.convert("invalid")); assertThat(thrown).isInstanceOf(FractionConversionException.class); }
@Test public void assertThatConvertHandlesProperlyAnInvalidStringOutOfRange() { final Throwable thrown = catchThrowable(() -> fractionConverter.convert("1.2")); assertThat(thrown).isInstanceOf(FractionConversionException.class); }