if (numerator == 0) { return ZERO; } double numeratorValue = (double) numerator * fraction.denominator; double denominatorValue = (double) denominator * fraction.numerator; if (Math.abs(numeratorValue) > Integer.MAX_VALUE || Math.abs(denominatorValue) > Integer.MAX_VALUE) { throw new ArithmeticException("Integer overflow"); } return getReducedFraction((int) numeratorValue, (int) denominatorValue);
return multiplyBy(fraction.invert());
    public Fraction divideBy(Fraction fraction) {        if (fraction == null) {            throw new IllegalArgumentException("The fraction must not be null");        }        if (fraction.numerator == 0) {            throw new ArithmeticException("The fraction to divide by must not be zero");        }        if (numerator == 0) {            return ZERO;        }          double numeratorValue = (double) numerator * fraction.denominator;        double denominatorValue = (double) denominator * fraction.numerator;        if (Math.abs(numeratorValue) > Integer.MAX_VALUE ||             Math.abs(denominatorValue) > Integer.MAX_VALUE) {                throw new ArithmeticException("Integer overflow");        }        return getReducedFraction((int) numeratorValue, (int) denominatorValue);    }