@Override
  protected void surroundExpression(@NotNull ActionContext context, @NotNull PsiExpression expr, @NotNull ModPsiUpdater updater) {
    Project project = context.project();
    PsiElementFactory factory = JavaPsiFacade.getElementFactory(project);
    CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project);

    @NonNls String text = "if(a){\nst;\n}";
    PsiIfStatement ifStatement = (PsiIfStatement)factory.createStatementFromText(text, null);
    ifStatement = (PsiIfStatement)codeStyleManager.reformat(ifStatement);

    PsiExpression condition = ifStatement.getCondition();
    if (condition != null) {
      condition.replace(expr);
    }

    PsiExpressionStatement statement = (PsiExpressionStatement)expr.getParent();
    ifStatement = (PsiIfStatement)statement.replace(ifStatement);

    PsiStatement thenBranch = ifStatement.getThenBranch();
    if (thenBranch instanceof PsiBlockStatement blockStatement) {
      PsiCodeBlock block = blockStatement.getCodeBlock();
      block = CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(block);
      TextRange range = block.getStatements()[0].getTextRange();
      block.getContainingFile().getFileDocument().deleteString(range.getStartOffset(), range.getEndOffset());
      updater.select(TextRange.from(range.getStartOffset(), 0));
    }
  }
@Override
  protected void surroundExpression(@NotNull ActionContext context, @NotNull PsiExpression expr, @NotNull ModPsiUpdater updater)