boolean (@NotNull PsiClassType type1, @NotNull PsiClassType type2) { PsiClassType.ClassResolveResult resolveResult1 = type1.resolveGenerics(); PsiClassType.ClassResolveResult resolveResult2 = type2.resolveGenerics(); final PsiClass aClass = resolveResult1.getElement(); final PsiClass bClass = resolveResult2.getElement(); return aClass != null && bClass != null && aClass.getManager().areElementsEquivalent(aClass, bClass) && areSameArgumentTypes(aClass, resolveResult1.getSubstitutor(), resolveResult2.getSubstitutor(), 1); }