docs: public <T> Class<T> loadClass(final String className, final Class<T> superclassOrInterfaceType,
              final boolean returnNullIfClassNotFound) throws IllegalArgumentException {
          if (closed.get()) {
              throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
          }
          if (className == null || className.isEmpty()) {
              throw new NullPointerException("className cannot be null or empty");
          }
          if (superclassOrInterfaceType == null) {
              throw new NullPointerException("superclassOrInterfaceType parameter cannot be null");
          }
          final Class<?> loadedClass;
          try {
              loadedClass = Class.forName(className, scanSpec.initializeLoadedClasses, classGraphClassLoader);
          } catch (final ClassNotFoundException | LinkageError e) {
              if (returnNullIfClassNotFound) {
                  return null;
              } else {
                  throw new IllegalArgumentException("Could not load class " + className + " : " + e);
              }
          }
          if (loadedClass != null && !superclassOrInterfaceType.isAssignableFrom(loadedClass)) {
              if (returnNullIfClassNotFound) {
                  return null;
              } else {
                  throw new IllegalArgumentException("Loaded class " + loadedClass.getName() + " cannot be cast to "
                          + superclassOrInterfaceType.getName());
              }
          }
          @SuppressWarnings("unchecked")
          final Class<T> castClass = (Class<T>) loadedClass;
          return castClass;
  
      }