### Question:
Fraction { public static Fraction fromFloat(final float val) { checkArgument(val > 0.0f && val <= 1.0f); return new Fraction(val); } 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 assertThatAFractionCannotBeBuiltFromAnInvalidDouble() { final Throwable thrown = catchThrowable(() -> Fraction.fromFloat(1.2f)); assertThat(thrown).isInstanceOf(IllegalArgumentException.class); }