docs: public ClassInfoList getAnnotations() {
          if (!scanResult.scanSpec.enableAnnotationInfo) {
              throw new IllegalArgumentException("Please call ClassGraph#enableAnnotationInfo() before #scan()");
          }
  
          // Get all annotations on this class
          final ReachableAndDirectlyRelatedClasses annotationClasses = this.filterClassInfo(RelType.CLASS_ANNOTATIONS,
                  /* strictWhitelist = */ false);
          // Check for any @Inherited annotations on superclasses
          Set<ClassInfo> inheritedSuperclassAnnotations = null;
          for (final ClassInfo superclass : getSuperclasses()) {
              for (final ClassInfo superclassAnnotation : superclass.filterClassInfo(RelType.CLASS_ANNOTATIONS,
                      /* strictWhitelist = */ false).reachableClasses) {
                  // Check if any of the meta-annotations on this annotation are @Inherited,
                  // which causes an annotation to annotate a class and all of its subclasses.
                  if (superclassAnnotation != null && superclassAnnotation.isInherited) {
                      // superclassAnnotation has an @Inherited meta-annotation
                      if (inheritedSuperclassAnnotations == null) {
                          inheritedSuperclassAnnotations = new LinkedHashSet<>();
                      }
                      inheritedSuperclassAnnotations.add(superclassAnnotation);
                  }
              }
          }
  
          if (inheritedSuperclassAnnotations == null) {
              // No inherited superclass annotations
              return new ClassInfoList(annotationClasses, /* sortByName = */ true);
          } else {
              // Merge inherited superclass annotations and annotations on this class
              inheritedSuperclassAnnotations.addAll(annotationClasses.reachableClasses);
              return new ClassInfoList(inheritedSuperclassAnnotations, annotationClasses.directlyRelatedClasses,
                      /* sortByName = */ true);
          }
      }