static HighlightInfo.Builder checkExtendsDuplicate(@NotNull PsiJavaCodeReferenceElement element, 
                                                     @Nullable PsiElement resolved, 
                                                     @NotNull PsiFile containingFile) {
    if (!(element.getParent() instanceof PsiReferenceList list)) return null;
    if (!(list.getParent() instanceof PsiClass)) return null;
    if (!(resolved instanceof PsiClass aClass)) return null;
    PsiManager manager = containingFile.getManager();
    PsiJavaCodeReferenceElement sibling = PsiTreeUtil.getPrevSiblingOfType(element, PsiJavaCodeReferenceElement.class);
    while (true) {
      if (sibling == null) return null;
      PsiElement target = sibling.resolve();
      if (manager.areElementsEquivalent(target, aClass)) break;
      sibling = PsiTreeUtil.getPrevSiblingOfType(sibling, PsiJavaCodeReferenceElement.class);
    }
    String name = HighlightUtil.formatClass(aClass);
    String description = JavaErrorBundle.message("duplicate.reference.in.list", name, list.getFirstChild().getText());
    HighlightInfo.Builder info =
      HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(element).descriptionAndTooltip(description);
    IntentionAction action = QuickFixFactory.getInstance().createRemoveDuplicateExtendsAction(name);
    info.registerFix(action, null, null, null, null);
    return info;
  }
static HighlightInfo.Builder checkExtendsDuplicate(@NotNull PsiJavaCodeReferenceElement element, 
                                                     @Nullable PsiElement resolved, 
                                                     @NotNull PsiFile containingFile)