public static @Nullable List<Throwable> handleException(@NotNull Throwable e, @Nullable List<Throwable> exceptions) {
    Throwable exception = e;
    if (e instanceof InvocationTargetException) {
      Throwable cause = e.getCause();
      if (cause != null) {
        // Do nothing for AbstractMethodError. This listener just does not implement something newly added yet.
        if (cause instanceof AbstractMethodError) {
          return exceptions;
        }

        exception = cause;
      }
    }

    if (exceptions == null) {
      exceptions = new ArrayList<>();
    }
    exceptions.add(exception);
    return exceptions;
  }
public static @Nullable List<Throwable> handleException(@NotNull Throwable e, @Nullable List<Throwable> exceptions)