private static @Nullable IfConditionalModel extractFromAssignment(@Nullable PsiExpression condition,
                                                                    @Nullable PsiStatement thenStatement,
                                                                    @Nullable PsiStatement elseStatement, boolean explicit) {
    condition = PsiUtil.skipParenthesizedExprDown(condition);
    if (condition == null) return null;
    PsiExpressionStatement thenBranch = tryCast(stripBraces(thenStatement), PsiExpressionStatement.class);
    PsiExpressionStatement elseBranch = tryCast(stripBraces(elseStatement), PsiExpressionStatement.class);
    if (thenBranch == null || elseBranch == null) return null;
    PsiAssignmentExpression thenExpression = tryCast(thenBranch.getExpression(), PsiAssignmentExpression.class);
    PsiAssignmentExpression elseExpression = tryCast(elseBranch.getExpression(), PsiAssignmentExpression.class);
    if (thenExpression == null || elseExpression == null) return null;
    PsiExpression thenRhs = thenExpression.getRExpression();
    PsiExpression elseRhs = elseExpression.getRExpression();
    if (thenRhs == null || elseRhs == null) return null;
    IElementType thenTokenType = thenExpression.getOperationTokenType();
    IElementType elseTokenType = elseExpression.getOperationTokenType();
    if (!explicit && !thenTokenType.equals(JavaTokenType.EQ)) return null;
    final boolean operationIsOpposite = areOppositeAssignmentTokens(thenTokenType, elseTokenType);
    // Will be warned about equivalent if branches; no need to add ?: warning as well
    if (!operationIsOpposite && EquivalenceChecker.getCanonicalPsiEquivalence().expressionsAreEquivalent(thenRhs, elseRhs)) return null;
    if (!(thenTokenType.equals(elseTokenType) || operationIsOpposite)) return null;

    PsiExpression thenLhs = thenExpression.getLExpression();
    PsiExpression elseLhs = elseExpression.getLExpression();
    if (!EquivalenceChecker.getCanonicalPsiEquivalence().expressionsAreEquivalent(thenLhs, elseLhs)) return null;
    PsiType type = thenLhs.getType();
    if (type == null) return null;
    final PsiExpression resultElseRhs = getResultElseRhs(elseRhs, operationIsOpposite);
    if (!explicit && !ExpressionUtils.isSafelyRecomputableExpression(elseRhs)) return null;
    return new IfConditionalModel(condition, thenRhs, resultElseRhs, thenBranch, elseBranch, type);
  }
private static @Nullable IfConditionalModel extractFromAssignment(@Nullable PsiExpression condition,
                                                                    @Nullable PsiStatement thenStatement,
                                                                    @Nullable PsiStatement elseStatement, boolean explicit)