public static <T extends GrStatement> T replaceWithStatement(GroovyPsiElement element, @NotNull T newStmt) {
    PsiElement parent = element.getParent();
    if (parent == null) {
      throw new PsiInvalidElementAccessException(element);
    }
    return (T)element.replace(newStmt);
  }
public static <T extends GrStatement> T replaceWithStatement(GroovyPsiElement element, @NotNull T newStmt)