Comparison (@NotNull PsiExpression expression, @NotNull PsiVariable loopVariable, boolean isNegated) { PsiBinaryExpression binaryExpression = tryCast(skipParenthesizedExprDown(expression), PsiBinaryExpression.class); if (binaryExpression == null) return null; IElementType sign = binaryExpression.getOperationSign().getTokenType(); PsiExpression rOperand = binaryExpression.getROperand(); if (rOperand == null) return null; PsiExpression lOperand = binaryExpression.getLOperand(); if (sign.equals(JavaTokenType.LT) || sign.equals(JavaTokenType.LE)) { Comparison extract = extractComparatorLikeComparison(lOperand, rOperand, loopVariable, isNegated); if (extract != null) return extract; return extract(lOperand, rOperand, loopVariable, isNegated, null, false); } else if (sign.equals(JavaTokenType.GT) || sign.equals(JavaTokenType.GE)) { Comparison extract = extractComparatorLikeComparison(lOperand, rOperand, loopVariable, !isNegated); if (extract != null) return extract; return extract(lOperand, rOperand, loopVariable, !isNegated, null, false); } return null; }