boolean (PsiStatement statement, PsiParameter parameter) { if (!(statement instanceof PsiIfStatement ifStatement)) return false; if (ifStatement.getElseBranch() != null) return false; if (!returnsBoolean(ifStatement.getThenBranch(), true)) return false; PsiExpression condition = PsiUtil.skipParenthesizedExprDown(ifStatement.getCondition()); OrderedBinaryExpression<PsiThisExpression, PsiExpression> expr = OrderedBinaryExpression.from(condition, PsiThisExpression.class); return expr != null && expr.getFirstOperand().getQualifier() == null && expr.getTokenType() == JavaTokenType.EQEQ && ExpressionUtils.isReferenceTo(expr.getSecondOperand(), parameter); }