static HighlightInfo.Builder checkAmbiguousMethodCallArguments(@NotNull PsiReferenceExpression referenceToMethod,
                                                                 JavaResolveResult @NotNull [] resolveResults,
                                                                 @NotNull PsiExpressionList list,
                                                                 PsiElement element,
                                                                 @NotNull JavaResolveResult resolveResult,
                                                                 @NotNull PsiMethodCallExpression methodCall,
                                                                 @NotNull PsiResolveHelper resolveHelper,
                                                                 @NotNull PsiElement elementToHighlight) {
    Pair<MethodCandidateInfo, MethodCandidateInfo> pair = findCandidates(resolveResults);
    MethodCandidateInfo methodCandidate1 = pair.first;
    MethodCandidateInfo methodCandidate2 = pair.second;
    MethodCandidateInfo[] candidates = toMethodCandidates(resolveResults);

    String description;
    String toolTip;
    if (methodCandidate2 != null) {
      if (IncompleteModelUtil.isIncompleteModel(list) &&
          ContainerUtil.exists(list.getExpressions(), e -> IncompleteModelUtil.mayHaveUnknownTypeDueToPendingReference(e))) {
        return null;
      }
      PsiMethod element1 = methodCandidate1.getElement();
      String m1 = PsiFormatUtil.formatMethod(element1,
                                             methodCandidate1.getSubstitutor(false),
                                             PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_NAME |
                                             PsiFormatUtilBase.SHOW_PARAMETERS,
                                             PsiFormatUtilBase.SHOW_TYPE);
      PsiMethod element2 = methodCandidate2.getElement();
      String m2 = PsiFormatUtil.formatMethod(element2,
                                             methodCandidate2.getSubstitutor(false),
                                             PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_NAME |
                                             PsiFormatUtilBase.SHOW_PARAMETERS,
                                             PsiFormatUtilBase.SHOW_TYPE);
      VirtualFile virtualFile1 = PsiUtilCore.getVirtualFile(element1);
      VirtualFile virtualFile2 = PsiUtilCore.getVirtualFile(element2);
      if (!Comparing.equal(virtualFile1, virtualFile2)) {
        if (virtualFile1 != null) m1 += " (In " + virtualFile1.getPresentableUrl() + ")";
        if (virtualFile2 != null) m2 += " (In " + virtualFile2.getPresentableUrl() + ")";
      }
      description = JavaErrorBundle.message("ambiguous.method.call", m1, m2);
      toolTip = createAmbiguousMethodHtmlTooltip(new MethodCandidateInfo[]{methodCandidate1, methodCandidate2});
    }
    else {
      if (element != null && (!resolveResult.isAccessible() || !resolveResult.isStaticsScopeCorrect())) {
        return null;
      }
      if (candidates.length == 0) {
        return null;
      }
      if (IncompleteModelUtil.isIncompleteModel(list) &&
          ContainerUtil.exists(list.getExpressions(), IncompleteModelUtil::mayHaveUnknownTypeDueToPendingReference)) {
        return null;
      }
      String methodName = referenceToMethod.getReferenceName() + buildArgTypesList(list, true);
      description = JavaErrorBundle.message("cannot.resolve.method", methodName);
      toolTip = XmlStringUtil.escapeString(description);
    }
    if (PsiTreeUtil.hasErrorElements(list)) {
      return null;
    }
    TextRange fixRange = getFixRange(elementToHighlight);
    HighlightInfo.Builder builder = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(elementToHighlight).description(description).escapedToolTip(toolTip);
    if (!resolveResult.isAccessible() && resolveResult.isStaticsScopeCorrect() && methodCandidate2 != null) {
      HighlightFixUtil.registerAccessQuickFixAction(builder, fixRange, (PsiJvmMember)element, referenceToMethod, resolveResult.getCurrentFileResolveScope(), fixRange);
    }
    if (methodCandidate2 == null) {
      registerMethodCallIntentions(builder, methodCall, list, resolveHelper);
    }
    if (element != null && !resolveResult.isStaticsScopeCorrect()) {
      HighlightFixUtil.registerStaticProblemQuickFixAction(builder, element, referenceToMethod);
    }
    CastMethodArgumentFix.REGISTRAR.registerCastActions(candidates, methodCall, builder, fixRange);
    WrapWithAdapterMethodCallFix.registerCastActions(candidates, methodCall, builder, fixRange);
    WrapObjectWithOptionalOfNullableFix.REGISTAR.registerCastActions(candidates, methodCall, builder, fixRange);
    WrapExpressionFix.registerWrapAction(candidates, list.getExpressions(), builder, fixRange);
    PermuteArgumentsFix.registerFix(builder, methodCall, candidates, fixRange);
    registerChangeParameterClassFix(methodCall, list, builder, fixRange);
    return builder;
  }
static HighlightInfo.Builder checkAmbiguousMethodCallArguments(@NotNull PsiReferenceExpression referenceToMethod,
                                                                 JavaResolveResult @NotNull [] resolveResults,
                                                                 @NotNull PsiExpressionList list,
                                                                 PsiElement element,
                                                                 @NotNull JavaResolveResult resolveResult,
                                                                 @NotNull PsiMethodCallExpression methodCall,
                                                                 @NotNull PsiResolveHelper resolveHelper,
                                                                 @NotNull PsiElement elementToHighlight)