code: public ClassInfoList getAllInterfacesAndAnnotations() {
          if (closed.get()) {
              throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
          }
          if (!scanSpec.enableClassInfo || !scanSpec.enableAnnotationInfo) {
              throw new IllegalArgumentException(
                      "Please call ClassGraph#enableClassInfo() and #enableAnnotationInfo() before #scan()");
          }
          return ClassInfo.getAllInterfacesOrAnnotationClasses(classNameToClassInfo.values(), scanSpec);
      }
docs: Get all interface or annotation classes found during the scan. (Annotations are technically interfaces, and
  they can be implemented.)
  
  @return A list of all whitelisted interfaces found during the scan, or the empty list if none.