int (@NotNull List<CandidateInfo> conflicts, Map<MethodCandidateInfo, PsiSubstitutor> map) { @MethodCandidateInfo.ApplicabilityLevelConstant int maxApplicabilityLevel = 0; boolean toFilter = false; for (CandidateInfo conflict : conflicts) { ProgressManager.checkCanceled(); @MethodCandidateInfo.ApplicabilityLevelConstant final int level = getPertinentApplicabilityLevel((MethodCandidateInfo)conflict, map); if (maxApplicabilityLevel > 0 && maxApplicabilityLevel != level) { toFilter = true; } if (level > maxApplicabilityLevel) { maxApplicabilityLevel = level; } } if (toFilter) { for (Iterator<CandidateInfo> iterator = conflicts.iterator(); iterator.hasNext();) { ProgressManager.checkCanceled(); CandidateInfo info = iterator.next(); final int level = getPertinentApplicabilityLevel((MethodCandidateInfo)info, map); if (level < maxApplicabilityLevel) { iterator.remove(); } } } return maxApplicabilityLevel; }