boolean (Object obj) { if (this == obj) return true; if (!(obj instanceof PsiClassType)) { return obj instanceof PsiCapturedWildcardType && ((PsiCapturedWildcardType)obj).getLowerBound().equalsToText(CommonClassNames.JAVA_LANG_OBJECT) && equalsToText(CommonClassNames.JAVA_LANG_OBJECT); } PsiClassType otherClassType = (PsiClassType)obj; String className = getClassName(); String otherClassName = otherClassType.getClassName(); if (!Objects.equals(className, otherClassName)) return false; if (getParameterCount() != otherClassType.getParameterCount()) return false; final ClassResolveResult result = resolveGenerics(); final ClassResolveResult otherResult = otherClassType.resolveGenerics(); if (result == otherResult) return true; final PsiClass aClass = result.getElement(); final PsiClass otherClass = otherResult.getElement(); if (aClass == null || otherClass == null) { return aClass == otherClass; } return aClass.getManager().areElementsEquivalent(aClass, otherClass) && PsiUtil.equalOnEquivalentClasses(this, aClass, otherClassType, otherClass); }