docs: private static void extractAndAddPackageInfo(ClassInfo classInfo, Set<String> packages, IndexView indexView) {
          if (classInfo == null) {
              return;
          }
  
          // Check if we were given an abstract class / interface, in which case we need to check the IndexView to see if there
          // is an implementation or not.
          String className = classInfo.name().toString();
          if (indexView != null) {
              DotName dotName = DotName.createSimple(className);
              if (Modifier.isInterface(classInfo.flags())) {
                  indexView.getAllKnownImplementors(dotName).forEach(ci -> extractAndAddPackageInfo(ci, packages, indexView));
              } else if (Modifier.isAbstract(classInfo.flags())) {
                  indexView.getAllKnownSubclasses(dotName).forEach(ci -> extractAndAddPackageInfo(ci, packages, indexView));
              }
          }
          StringBuilder builder = new StringBuilder(className).reverse();
          int idx = builder.indexOf(".");
          if (idx != -1) {
              builder.delete(0, idx + 1);
          }
          packages.add(builder.reverse().toString());
      }