boolean (PsiElement expr, PsiElement parent) { if (parent instanceof PsiIfStatement) { return checkSameExpression(expr, ((PsiIfStatement)parent).getCondition()); } if (parent instanceof PsiConditionalLoopStatement) { return checkSameExpression(expr, ((PsiConditionalLoopStatement)parent).getCondition()); } if (parent instanceof PsiConditionalExpression) { return checkSameExpression(expr, ((PsiConditionalExpression)parent).getCondition()); } return false; }