@Override
  protected GroovyPsiElement doSurroundElements(PsiElement[] elements, PsiElement context) throws IncorrectOperationException {
    GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(elements[0].getProject());

    final PsiElement e0 = elements[0];
    final PsiElement parent = e0.getParent();

    final GrCodeBlock block;
    if (parent instanceof GrControlStatement) {
      block = factory.createMethodBodyFromText("\n");
      final PsiElement prev = e0.getPrevSibling();
      if (prev != null && prev.getNode().getElementType().equals(GroovyTokenTypes.mNLS)) {
        final ASTNode parentNode = e0.getParent().getNode();
        parentNode.addLeaf(TokenType.WHITE_SPACE, " ", prev.getNode());
        parentNode.removeChild(prev.getNode());
      }
    }
    else {
      block = factory.createClosureFromText("{}");
    }

    GroovyManyStatementsSurrounder.addStatements(block, elements);
    return block;
  }
@Override
  protected GroovyPsiElement doSurroundElements(PsiElement[] elements, PsiElement context)