### Question:
Fraction { public static Fraction fromString(final String str) { checkArgument(str != null); return fromFloat(parseFloat(str)); } private  Fraction(final float value); static Fraction fromPercentage(final int percentage); static Fraction fromPercentage(final Percentage percentage); Percentage toPercentage(); static Fraction fromString(final String str); static Fraction fromFloat(final float val); float getValue(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void assertThatAFractionCannotBeBuiltFromAnInvalidString() { final Throwable thrown = catchThrowable(() -> Fraction.fromString("not a fraction")); assertThat(thrown).isInstanceOf(IllegalArgumentException.class); }