### Question:
Fraction { public double getValue(){ if (denominator == 0) { throw new IllegalArgumentException(); } return ((double) this.numerator)/this.denominator; } Fraction(int numerator, int denominator); double getValue(); double getShiftedValue(int shift);  }### Answer:
@Test (expected = java.lang.IllegalArgumentException.class) public void getValue_zeroCase(){ Fraction f = new Fraction(1,0); f.getValue(); }
@Test public void getValue(){ Fraction f = new Fraction(1,2); double value = f.getValue(); assertEquals (0.5, value, 0.0000001); }