public static boolean equalOnEquivalentClasses(@NotNull PsiClassType thisClassType,
                                                 @NotNull PsiClass aClass,
                                                 @NotNull PsiClassType otherClassType,
                                                 @NotNull PsiClass bClass) {
    PsiClassType capture1 = !PsiCapturedWildcardType.isCapture()
                                  ? thisClassType : (PsiClassType)captureToplevelWildcards(thisClassType, aClass);
    PsiClassType capture2 = !PsiCapturedWildcardType.isCapture()
                                  ? otherClassType : (PsiClassType)captureToplevelWildcards(otherClassType, bClass);

    PsiClassType.ClassResolveResult result1 = capture1.resolveGenerics();
    PsiClassType.ClassResolveResult result2 = capture2.resolveGenerics();

    return equalOnEquivalentClasses(result1.getSubstitutor(), aClass, result2.getSubstitutor(), bClass);
  }
public static boolean equalOnEquivalentClasses(@NotNull PsiClassType thisClassType,
                                                 @NotNull PsiClass aClass,
                                                 @NotNull PsiClassType otherClassType,
                                                 @NotNull PsiClass bClass)