Match (@NotNull PsiBinaryExpression binaryExpression1, @NotNull PsiBinaryExpression binaryExpression2) { final IElementType tokenType1 = binaryExpression1.getOperationTokenType(); final IElementType tokenType2 = binaryExpression2.getOperationTokenType(); final PsiExpression left1 = PsiUtil.skipParenthesizedExprDown(binaryExpression1.getLOperand()); final PsiExpression left2 = PsiUtil.skipParenthesizedExprDown(binaryExpression2.getLOperand()); final PsiExpression right1 = PsiUtil.skipParenthesizedExprDown(binaryExpression1.getROperand()); final PsiExpression right2 = PsiUtil.skipParenthesizedExprDown(binaryExpression2.getROperand()); if (!tokenType1.equals(tokenType2)) { // process matches like "a < b" and "b > a" final RelationType rel1 = DfaPsiUtil.getRelationByToken(tokenType1); final RelationType rel2 = DfaPsiUtil.getRelationByToken(tokenType2); if (rel1 != null && rel2 != null && rel1.getFlipped() == rel2) { return labelElementsAreEquivalent(new PsiExpression[]{left1, right1}, new PsiExpression[]{right2, left2}, false); } return EXACT_MISMATCH; } return labelElementsAreEquivalent(new PsiExpression[]{left1, right1}, new PsiExpression[]{left2, right2}, ParenthesesUtils.isCommutativeOperation(binaryExpression1)); }