private static void renameProject(final @NotNull String newName,
                                    final @NotNull ProjectSystemId externalSystemId,
                                    final @NotNull Project project)
  {
    if (!(project instanceof ProjectEx) || newName.equals(project.getName())) {
      return;
    }
    ExternalSystemApiUtil.executeProjectChangeAction(true, project, () -> {
      String oldName = project.getName();
      ((ProjectEx)project).setProjectName(newName);
      ExternalSystemApiUtil.getSettings(project, externalSystemId).getPublisher().onProjectRenamed(oldName, newName);
    });
  }
private static void renameProject(final @NotNull String newName,
                                    final @NotNull ProjectSystemId externalSystemId,
                                    final @NotNull Project project)