docs: public Violation checkForImmutability(
        Optional<ClassTree> tree,
        ImmutableSet<String> immutableTyParams,
        ClassType type,
        ViolationReporter reporter) {
      Violation info = areFieldsImmutable(tree, immutableTyParams, type, reporter);
      if (info.isPresent()) {
        return info;
      }
  
      for (Type interfaceType : state.getTypes().interfaces(type)) {
        AnnotationInfo interfaceAnnotation = getImmutableAnnotation(interfaceType.tsym, state);
        if (interfaceAnnotation == null) {
          continue;
        }
        info =
            threadSafety.checkSuperInstantiation(
                immutableTyParams, interfaceAnnotation, interfaceType);
        if (info.isPresent()) {
          return info.plus(
              String.format(
                  "'%s' extends '%s'",
                  threadSafety.getPrettyName(type.tsym),
                  threadSafety.getPrettyName(interfaceType.tsym)));
        }
      }
  
      if (!type.asElement().isEnum()) {
        // don't check enum super types here to avoid double-reporting errors
        info = checkSuper(immutableTyParams, type);
        if (info.isPresent()) {
          return info;
        }
      }
      Type mutableEnclosing = threadSafety.mutableEnclosingInstance(tree, type);
      if (mutableEnclosing != null) {
        return info.plus(
            String.format(
                "'%s' has mutable enclosing instance '%s'",
                threadSafety.getPrettyName(type.tsym), mutableEnclosing));
      }
      return Violation.absent();
    }