static HighlightInfo.Builder checkExtendsAllowed(@NotNull PsiReferenceList list) {
    if (list.getParent() instanceof PsiClass aClass && (aClass.isEnum() || aClass.isRecord())) {
      boolean isExtends = list.equals(aClass.getExtendsList());
      if (isExtends) {
        String description = JavaErrorBundle.message(aClass.isRecord() ? "record.extends" : "extends.after.enum");
        HighlightInfo.Builder info =
          HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(list.getFirstChild()).descriptionAndTooltip(description);
        IntentionAction action = QuickFixFactory.getInstance().createDeleteFix(list);
        info.registerFix(action, null, null, null, null);
        return info;
      }
    }
    return null;
  }
static HighlightInfo.Builder checkExtendsAllowed(@NotNull PsiReferenceList list)