code: protected String getCallingClassName() {
          boolean outerSubclassReached = false;
          for (StackTraceElement element : Thread.currentThread().getStackTrace()) {
              // the method call that leads to the first invocation of this class or its subclass is considered the caller
              if (!knownClassNames.contains(element.getClassName())) {
                  if (outerSubclassReached) {
                      return element.getClassName();
                  }
              } else {
                  outerSubclassReached = true;
              }
          }
          throw BeanManagerLogger.LOG.unableToIdentifyBeanManager();
      }
docs: Examines {@link StackTraceElement}s to figure out which class invoked a method on {@link CDI}.