private boolean maybeReplaceDuplicateExpression(
      @NotNull PsiBinaryExpression visitedElement,
      @NotNull PsiBinaryExpression lBinaryExpression,
      @NotNull PsiExpression factor,
      @NotNull PsiExpression factorDuplicate,
      @NotNull PsiExpression thenExpression,
      @NotNull PsiExpression elseExpression,
      boolean eagerEvaluation,
      boolean isThenExpressionFirst,
      boolean isElseExpressionLast
    ) {
      if (EquivalenceChecker.getCanonicalPsiEquivalence().expressionsAreEquivalent(factor, factorDuplicate)
          && !EquivalenceChecker.getCanonicalPsiEquivalence().expressionsAreEquivalent(thenExpression, elseExpression)
          && !BoolUtils.areExpressionsOpposite(thenExpression, elseExpression)
          && isPassiveWithoutBreak(factor)) {
        final boolean isThenExpressionPassiveWithoutBreak = isPassiveWithoutBreak(thenExpression);
        final boolean isElseExpressionPassiveWithoutBreak = isPassiveWithoutBreak(elseExpression);
        if (isThenExpressionPassiveWithoutBreak
            && isElseExpressionLast
            && (eagerEvaluation || isElseExpressionPassiveWithoutBreak)) {
          warnOrFix(visitedElement, lBinaryExpression, factorDuplicate, thenExpression, elseExpression, true);
          return true;
        }
        if (isElseExpressionPassiveWithoutBreak
            && (isThenExpressionFirst || isThenExpressionPassiveWithoutBreak)) {
          warnOrFix(visitedElement, lBinaryExpression, factorDuplicate, thenExpression, elseExpression, false);
          return true;
        }
      }
      return false;
    }
private boolean maybeReplaceDuplicateExpression(
      @NotNull PsiBinaryExpression visitedElement,
      @NotNull PsiBinaryExpression lBinaryExpression,
      @NotNull PsiExpression factor,
      @NotNull PsiExpression factorDuplicate,
      @NotNull PsiExpression thenExpression,
      @NotNull PsiExpression elseExpression,
      boolean eagerEvaluation,
      boolean isThenExpressionFirst,
      boolean isElseExpressionLast
    )