public static void refreshProjects(final @NotNull ImportSpec spec) {
    var manager = ExternalSystemApiUtil.getManager(spec.getExternalSystemId());
    if (manager == null) {
      return;
    }
    var settings = manager.getSettingsProvider().fun(spec.getProject());
    var projectsSettings = settings.getLinkedProjectsSettings();
    if (projectsSettings.isEmpty()) {
      return;
    }

    final ExternalProjectRefreshCallback callback;
    if (spec.getCallback() == null) {
      callback = new MyMultiExternalProjectRefreshCallback(spec.getProject());
    }
    else {
      callback = spec.getCallback();
    }

    var toRefresh = new HashSet<String>();
    for (var setting : projectsSettings) {
      toRefresh.add(setting.getExternalProjectPath());
    }

    if (!toRefresh.isEmpty()) {
      ExternalSystemNotificationManager.getInstance(spec.getProject())
        .clearNotifications(null, NotificationSource.PROJECT_SYNC, spec.getExternalSystemId());

      for (var path : toRefresh) {
        refreshProject(path, new ImportSpecBuilder(spec).callback(callback));
      }
    }
  }
public static void refreshProjects(final @NotNull ImportSpec spec)