@Nullable
  private static ExtractionUnit extractHeadCommonStatement(@NotNull PsiStatement thenStmt,
                                                           @NotNull PsiStatement elseStmt,
                                                           @NotNull List<PsiLocalVariable> conditionVariables,
                                                           @NotNull LocalEquivalenceChecker equivalence) {
    if (thenStmt instanceof PsiDeclarationStatement) {
      return extractDeclarationUnit(thenStmt, elseStmt, conditionVariables, equivalence);
    }
    if (!equivalence.statementsAreEquivalent(thenStmt, elseStmt)) return null;
    boolean statementMayChangeSemantics = SideEffectChecker.mayHaveSideEffects(thenStmt, e -> false);
    boolean mayInfluenceCondition = mayInfluenceCondition(thenStmt, conditionVariables);
    return new ExtractionUnit(thenStmt, elseStmt, statementMayChangeSemantics, mayInfluenceCondition, true);
  }
@Nullable
  private static ExtractionUnit extractHeadCommonStatement(@NotNull PsiStatement thenStmt,
                                                           @NotNull PsiStatement elseStmt,
                                                           @NotNull List<PsiLocalVariable> conditionVariables,
                                                           @NotNull LocalEquivalenceChecker equivalence)