private static HighlightInfo.Builder checkDuplicateAttribute(@NotNull PsiNameValuePair pair) {
    PsiAnnotationParameterList annotation = (PsiAnnotationParameterList)pair.getParent();
    PsiNameValuePair[] attributes = annotation.getAttributes();
    for (PsiNameValuePair attribute : attributes) {
      if (attribute == pair) break;
      String name = pair.getName();
      if (Objects.equals(attribute.getName(), name)) {
        String description = JavaErrorBundle.message("annotation.duplicate.attribute",
                                                     name == null ? PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME : name);
        HighlightInfo.Builder info =
          HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(pair).descriptionAndTooltip(description);
        IntentionAction action1 = QuickFixFactory.getInstance().createDeleteFix(pair);
        info.registerFix(action1, null, null, null, null);
        IntentionAction action = QuickFixFactory.getInstance().createMergeDuplicateAttributesFix(pair);
        if (action != null) {
          info.registerFix(action, null, null, null, null);
        }
        return info;
      }
    }

    return null;
  }
private static HighlightInfo.Builder checkDuplicateAttribute(@NotNull PsiNameValuePair pair)