private static void modifyWorkspaceModel(@NotNull Project project,
                                           @Nls String message,
                                           @NonNls String cause,
                                           @NotNull Consumer<MutableEntityStorage> mutator) {
    new Task.Modal(project, message, true) {
      @Override
      public void run(@NotNull ProgressIndicator indicator) {
        WriteAction.runAndWait(() -> {
          WorkspaceModel.getInstance(project)
            .updateProjectModel(cause, storage -> {
              mutator.accept(storage);
              return null;
            });
        });
      }
    }.queue();
  }
private static void modifyWorkspaceModel(@NotNull Project project,
                                           @Nls String message,
                                           @NonNls String cause,
                                           @NotNull Consumer<MutableEntityStorage> mutator)