boolean (GrInstanceOfExpression expression1, GrInstanceOfExpression expression2) { final GrExpression operand1 = expression1.getOperand(); final GrExpression operand2 = expression2.getOperand(); if (!expressionsAreEquivalent(operand1, operand2)) { return false; } GrTypeElement typeElement1 = expression1.getTypeElement(); GrTypeElement typeElement2 = expression2.getTypeElement(); if (typeElement1 == null || typeElement2 == null) return false; final PsiType type1 = typeElement1.getType(); final PsiType type2 = typeElement2.getType(); return typesAreEquivalent(type1, type2); }