### Question:
PercentageConverter implements CommandLine.ITypeConverter<Integer> { @Override public Integer convert(final String value) throws PercentageConversionException { try { return Percentage.fromString(value).getValue(); } catch (NullPointerException | IllegalArgumentException e) { throw new PercentageConversionException(value); } }  @Override Integer convert(final String value);  }### Answer:
@Test public void assertThatConvertHandlesProperlyAValidString() throws PercentageConversionException { final int percentage = percentageConverter.convert("58"); assertThat(percentage).isNotNull(); assertThat(percentage).isEqualTo(58); }
@Test public void assertThatConvertHandlesProperlyAnInvalidStringNotANumber() { final Throwable thrown = catchThrowable(() -> percentageConverter.convert("invalid")); assertThat(thrown).isInstanceOf(PercentageConversionException.class); }
@Test public void assertThatConvertHandlesProperlyAnInvalidStringOutOfRange() { final Throwable thrown = catchThrowable(() -> percentageConverter.convert("150")); assertThat(thrown).isInstanceOf(PercentageConversionException.class); }