code: private Throwable extractThrowable(Throwable exception, Class<?> causeClass) {
          if (exception == null) {
              return null;
          } else if (causeClass.isInstance(exception)) {
              return exception;
          } else {
              return extractThrowable(exception.getCause(), causeClass);
          }
      }
docs: Extracts the requested throwable from given {@link Throwable}.
  
  @param exception  the complete exception stack
  @param causeClass the requested cause to search for
  @return found throwable or null