MethodSignature (@NotNull PsiMethod method, @NotNull PsiType type) { PsiClassType.ClassResolveResult classResolveResult = PsiUtil.resolveGenericsClassInType(type); final PsiClass aClass = classResolveResult.getElement(); if (aClass == null) return method.getSignature(PsiSubstitutor.EMPTY); PsiClass methodContainingClass = method.getContainingClass(); if (methodContainingClass == null) return method.getSignature(PsiSubstitutor.EMPTY); PsiSubstitutor substitutor = TypeConversionUtil.getClassSubstitutor(methodContainingClass, aClass, classResolveResult.getSubstitutor()); if (substitutor == null) { substitutor = PsiSubstitutor.EMPTY; } return method.getSignature(substitutor); }