private static boolean canThrow(@NotNull Throwable cause, @NotNull Method method) {
    for (Class<?> each : method.getExceptionTypes()) {
      if (each.isInstance(cause)) return true;
    }
    return false;
  }
private static boolean canThrow(@NotNull Throwable cause, @NotNull Method method)