boolean (GrMethodCall methodCall) { PsiElement parent = methodCall.getParent(); if (parent instanceof GrIfStatement || parent instanceof GrWhileStatement) return true; if (parent instanceof GrConditionalExpression && ((GrConditionalExpression)parent).getCondition().equals(methodCall)) return true; if (parent instanceof GrUnaryExpression && PsiTypes.booleanType().equals(((GrUnaryExpression)parent).getType())) return true; if (parent instanceof GrBinaryExpression && PsiTypes.booleanType().equals(((GrBinaryExpression)parent).getType())) return true; return false; }