### Question:
RationalNumber { public void optimize() { int gcd = calcGcd(numerator, denominator); this.numerator = this.numerator / gcd; this.denominator = this.denominator / gcd; } RationalNumber(int numerator, int denominator); static RationalNumber create(int numerator, int denominator); int getNumerator(); int getDenominator(); void optimize(); String toString(); boolean equals(Object obj); int hashCode();  }### Answer:
@Test public void optimizeTest() throws Exception { RationalNumber actual = RationalNumber.create(15, 9); actual.optimize(); RationalNumber expected = RationalNumber.create(5, 3); Assert.assertEquals(expected, actual); }