@Override
  protected TextRange surroundExpression(@NotNull GrExpression expression, PsiElement context) {
    GrIfStatement ifStatement = (GrIfStatement) GroovyPsiElementFactory.getInstance(expression.getProject()).createStatementFromText("if(a){4\n}", context);
    replaceToOldExpression(ifStatement.getCondition(), expression);
    ifStatement = expression.replaceWithStatement(ifStatement);
    GrStatement thenBranch = ifStatement.getThenBranch();

    assert thenBranch instanceof GrBlockStatement;
    GrStatement[] statements = ((GrBlockStatement) thenBranch).getBlock().getStatements();
    assert statements.length > 0;

    GrStatement statement = statements[0];
    int endOffset = statement.getTextRange().getStartOffset();
    statement.getNode().getTreeParent().removeChild(statement.getNode());

    return new TextRange(endOffset, endOffset);
  }
@Override
  protected TextRange surroundExpression(@NotNull GrExpression expression, PsiElement context)