boolean (@NotNull PsiTypeCastExpression pattern, @NotNull PsiTypeCastExpression candidate) { final PsiTypeElement castTypeElement1 = pattern.getCastType(); final PsiTypeElement castTypeElement2 = candidate.getCastType(); if (castTypeElement1 != null && castTypeElement2 != null) { final PsiType type1 = TypeConversionUtil.erasure(castTypeElement1.getType()); final PsiType type2 = TypeConversionUtil.erasure(castTypeElement2.getType()); if (!type1.equals(type2)) return false; } return true; }