@Nullable static IfInspectionResult inspect(@NotNull PsiIfStatement ifStatement,
                                                PsiStatement @NotNull [] thenBranch,
                                                PsiStatement @NotNull [] elseBranch,
                                                boolean isOnTheFly,
                                                IfStatementWithIdenticalBranchesInspection inspection) {
      ThenElse thenElse = from(ifStatement, thenBranch, elseBranch, isOnTheFly);
      if (thenElse == null) return null;
      boolean isNotInCodeBlock = !(ifStatement.getParent() instanceof PsiCodeBlock);
      boolean mayChangeSemantics = thenElse.myMayChangeSemantics;
      CommonPartType type = thenElse.myCommonPartType;
      ExtractCommonIfPartsFix fix = new ExtractCommonIfPartsFix(type, mayChangeSemantics, isOnTheFly);
      boolean tailStatementIsSingleCall = !inspection.myHighlightWhenLastStatementIsCall
                                          && (thenBranch.length > 1 || elseBranch.length > 1)
                                          && isSingleCallTail(thenElse.myTailStatementsOfThen)
                                          && thenElse.myHeadUnitsOfThen.isEmpty();
      boolean isInfoLevel = mayChangeSemantics
                            || isNotInCodeBlock
                            || isVariableTypeWithRename(thenElse, type)
                            || tailStatementIsSingleCall;
      PsiElement elementToHighlight = isInfoLevel ? ifStatement : ifStatement.getFirstChild();
      if (type == CommonPartType.VARIABLES_ONLY && !isOnTheFly) return null;
      return new IfInspectionResult(elementToHighlight, !isInfoLevel, fix, type.getDescriptionMessage(mayChangeSemantics));
    }
@Nullable static IfInspectionResult inspect(@NotNull PsiIfStatement ifStatement,
                                                PsiStatement @NotNull [] thenBranch,
                                                PsiStatement @NotNull [] elseBranch,
                                                boolean isOnTheFly,
                                                IfStatementWithIdenticalBranchesInspection inspection)