boolean (@NotNull PsiMethod firstMethod, @NotNull PsiSubstitutor firstSubstitutor, @NotNull PsiMethod secondMethod, @NotNull PsiSubstitutor secondSubstitutor) { if (!firstMethod.getName().equals(secondMethod.getName())) { return false; } PsiParameterList firstMethodParameterList = firstMethod.getParameterList(); PsiParameterList secondMethodParameterList = secondMethod.getParameterList(); if (firstMethodParameterList.getParametersCount() != secondMethodParameterList.getParametersCount()) { return false; } PsiParameter[] firstMethodParameterListParameters = firstMethodParameterList.getParameters(); PsiParameter[] secondMethodParameterListParameters = secondMethodParameterList.getParameters(); for (int i = 0; i < firstMethodParameterListParameters.length; i++) { PsiType firstMethodParameterListParameterType = firstSubstitutor.substitute(firstMethodParameterListParameters[i].getType()); PsiType secondMethodParameterListParameterType = secondSubstitutor.substitute(secondMethodParameterListParameters[i].getType()); if (PsiTypes.nullType().equals(firstMethodParameterListParameterType)) { continue; } if (!PsiElementUtil.typesAreEquivalent(firstMethodParameterListParameterType, secondMethodParameterListParameterType)) { return false; } } return true; }