static HighlightInfo.Builder checkSealedClassInheritors(@NotNull PsiClass psiClass) {
    if (psiClass.hasModifierProperty(PsiModifier.SEALED)) {
      PsiIdentifier nameIdentifier = psiClass.getNameIdentifier();
      if (nameIdentifier == null) return null;
      if (psiClass.isEnum()) return null;

      Collection<PsiClass> inheritors = DirectClassInheritorsSearch.search(psiClass).findAll();
      if (inheritors.isEmpty()) {
        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
          .range(nameIdentifier)
          .descriptionAndTooltip(JavaErrorBundle.message("sealed.must.have.inheritors"))
          ;
      }
      PsiFile parentFile = psiClass.getContainingFile();
      PsiManager manager = parentFile.getManager();
      boolean hasOutsideClasses = ContainerUtil.exists(inheritors, inheritor -> !manager.areElementsEquivalent(
        inheritor.getNavigationElement().getContainingFile(), parentFile));
      if (hasOutsideClasses) {
        Map<PsiJavaCodeReferenceElement, PsiClass> permittedClassesRefs = getPermittedClassesRefs(psiClass);
        Collection<PsiClass> permittedClasses = permittedClassesRefs.values();
        boolean hasMissingInheritors = ContainerUtil.exists(inheritors, inheritor -> !permittedClasses.contains(inheritor));
        if (hasMissingInheritors) {
          HighlightInfo.Builder info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
            .range(nameIdentifier)
            .descriptionAndTooltip(JavaErrorBundle.message("permit.list.must.contain.outside.inheritors"));
          IntentionAction action = QuickFixFactory.getInstance().createFillPermitsListFix(nameIdentifier);
          info.registerFix(action, null, null, null, null);
          return info;
        }
      }
    }
    return null;
  }
static HighlightInfo.Builder checkSealedClassInheritors(@NotNull PsiClass psiClass)