You should not throw an ArithmeticException. Since the error is in the supplied arguments, throw an IllegalArgumentException
. As the documentation says:
Thrown to indicate that a method has been passed an illegal or inappropriate argument.
Which is exactly what is going on here.
if (divisor == 0) {
throw new IllegalArgumentException("Argument 'divisor' is 0");
}