@RequiresEdt
  public static boolean executeWriteCommand(@NotNull final Document document,
                                            @Nullable final Project project,
                                            @Nullable @Nls final String commandName,
                                            @NotNull final Runnable task) {
    return executeWriteCommand(project, document, commandName, null, UndoConfirmationPolicy.DEFAULT, false, task);
  }
@RequiresEdt
  public static boolean executeWriteCommand(@NotNull final Document document,
                                            @Nullable final Project project,
                                            @Nullable @Nls final String commandName,
                                            @NotNull final Runnable task)