CandidateInfo (@NotNull List<CandidateInfo> firstCandidates, @NotNull List<CandidateInfo> secondCandidates, boolean shouldBeStatic) { if (firstCandidates.size() == 1) { CandidateInfo candidateInfo = firstCandidates.get(0); PsiElement element = candidateInfo.getElement(); if (element instanceof PsiMethod) { boolean isStatic = ((PsiMethod)element).hasModifierProperty(PsiModifier.STATIC); if (shouldBeStatic == isStatic) { for (CandidateInfo secondCandidate : secondCandidates) { PsiElement psiElement = secondCandidate.getElement(); if (psiElement instanceof PsiMethod) { boolean oppositeStatic = ((PsiMethod)psiElement).hasModifierProperty(PsiModifier.STATIC); if (shouldBeStatic != oppositeStatic) { return null; } } } return candidateInfo; } } } return null; }