private CandidateInfo resolveConflicts(@NotNull List<CandidateInfo> firstCandidates,
                                           @NotNull List<CandidateInfo> secondCandidates,
                                           Map<MethodCandidateInfo, PsiSubstitutor> map,
                                           int applicabilityLevel) {
      int firstApplicability = checkApplicability(firstCandidates);
      checkSpecifics(firstCandidates, applicabilityLevel, map, 0);

      int secondApplicability = checkApplicability(secondCandidates);
      checkSpecifics(secondCandidates, applicabilityLevel, map, 1);

      if (firstApplicability < secondApplicability) {
        return secondCandidates.size() == 1 ? secondCandidates.get(0) : null;
      }

      if (secondApplicability < firstApplicability) {
        return firstCandidates.size() == 1 ? firstCandidates.get(0) : null;
      }

      return firstCandidates.size() + secondCandidates.size() == 1
             ? firstCandidates.isEmpty()
               ? secondCandidates.get(0)
               : firstCandidates.get(0)
             : null;
    }
private CandidateInfo resolveConflicts(@NotNull List<CandidateInfo> firstCandidates,
                                           @NotNull List<CandidateInfo> secondCandidates,
                                           Map<MethodCandidateInfo, PsiSubstitutor> map,
                                           int applicabilityLevel)