Collection<PsiMethod> (PsiMethod[] beforeMethods, PsiMethod compareMethod) { Collection<PsiMethod> result = new ArrayList<>(); for (PsiMethod psiMethod : beforeMethods) { final PsiParameterList compareMethodParameterList = compareMethod.getParameterList(); final PsiParameterList psiMethodParameterList = psiMethod.getParameterList(); if (compareMethod.getName().equals(psiMethod.getName()) && compareMethodParameterList.getParametersCount() == psiMethodParameterList.getParametersCount()) { final Collection<String> typesOfCompareMethod = mapToTypeString(compareMethodParameterList); final Collection<String> typesOfPsiMethod = mapToTypeString(psiMethodParameterList); if (typesOfCompareMethod.equals(typesOfPsiMethod)) { result.add(psiMethod); } } } return result; }