docs: public static <T extends Throwable> Throwable peel(final Throwable t, Class<T> allowedType,
                                                         String message, RuntimeExceptionFactory runtimeExceptionFactory) {
          if (t instanceof RuntimeException) {
              return t;
          }
  
          if (t instanceof ExecutionException || t instanceof InvocationTargetException) {
              final Throwable cause = t.getCause();
              if (cause != null) {
                  return peel(cause, allowedType, message, runtimeExceptionFactory);
              } else {
                  return runtimeExceptionFactory.create(t, message);
              }
          }
  
          if (allowedType != null && allowedType.isAssignableFrom(t.getClass())) {
              return t;
          }
  
          return runtimeExceptionFactory.create(t, message);
      }