private static void runAsWriteAction(Project project, Runnable action) {
    CommandProcessor.getInstance().executeCommand(
      project, () -> ApplicationManager.getApplication().runWriteAction(action), null, null);
  }
private static void runAsWriteAction(Project project, Runnable action)