docs: public static RecursionDetection detectRecursiveInjection(Throwable t) {
          RecursionDetection rd;
          boolean recursiveInjection = false;
          boolean logged = false;
          Throwable cause = t;
          Throwable lastCause = null;
          while (cause != null && cause != lastCause) {
              if (cause instanceof StackOverflowError ||
                  cause instanceof RecursiveInjectionException) {
                  recursiveInjection = true;
  
                  if (cause instanceof RecursiveInjectionException &&
                      ((RecursiveInjectionException) cause).ivLogged) {
                      logged = true;
                      break;
                  }
              }
              lastCause = cause;
              cause = cause.getCause();
          }
  
          if (recursiveInjection && logged) {
              rd = RecursionDetection.RecursiveAlreadyLogged;
          } else if (recursiveInjection) {
              rd = RecursionDetection.Recursive;
          } else {
              rd = RecursionDetection.NotRecursive;
          }
  
          return rd;
      }