@Test (expected = java.lang.ArithmeticException.class) public void getShiftedValue_crash() { Fraction f = new Fraction(1,2); f.getShiftedValue(-2); }
public double getShiftedValue(int shift){ if (denominator == 0) { throw new IllegalArgumentException(); } return this.numerator/(this.denominator + shift); }
Fraction { public double getShiftedValue(int shift){ if (denominator == 0) { throw new IllegalArgumentException(); } return this.numerator/(this.denominator + shift); } }
Fraction { public double getShiftedValue(int shift){ if (denominator == 0) { throw new IllegalArgumentException(); } return this.numerator/(this.denominator + shift); } Fraction(int numerator, int denominator); }
Fraction { public double getShiftedValue(int shift){ if (denominator == 0) { throw new IllegalArgumentException(); } return this.numerator/(this.denominator + shift); } Fraction(int numerator, int denominator); double getValue(); double getShiftedValue(int shift); }
Fraction { public double getShiftedValue(int shift){ if (denominator == 0) { throw new IllegalArgumentException(); } return this.numerator/(this.denominator + shift); } Fraction(int numerator, int denominator); double getValue(); double getShiftedValue(int shift);  }