use throw new RuntimeException("Thrown from reverse method") inside the if loop
basic exception concept
when you are throwing checked exception
you should either handle that exception inside the try/catch block or declare the method that throws checked exception .e.g. void methodName() throws CheckedException.
If you are calling a method that throws checked excpetion then that method call should be from try/catch block of the calling method ot the calling itself should be declared to duck that exception.
Also when you try to handle or duck the checked exception the block should contatin code that may throw checked exception else you will get compile time error.
But the above rules are not applicable to RuntimeException.It is not ncessary to catch or duck the RuntimeException.
FYI
Anything that extends Exception is checked and anything that extends RuntimeException are unchecked exception.