@Override public void validateFor(InvocationOnMock invocation) { if (throwable == null) { throw cannotStubWithNullThrowable(); } if (throwable instanceof RuntimeException || throwable instanceof Error) { return; } if (!new InvocationInfo(invocation).isValidException(throwable)) { throw checkedExceptionInvalid(throwable); } } }