private static Map<String, Pair<ProjectSystemId, ExternalProjectSettings>> getLinkedProjects(Project project) {
    Map<String, Pair<ProjectSystemId, ExternalProjectSettings>> result = new HashMap<>();
    for (ExternalSystemManager<?, ?, ?, ?, ?> manager : ExternalSystemManager.EP_NAME.getIterable()) {
      ProjectSystemId systemId = manager.getSystemId();
      AbstractExternalSystemSettings systemSettings = ExternalSystemApiUtil.getSettings(project, systemId);
      Collection projectsSettings = systemSettings.getLinkedProjectsSettings();
      for (Object settings : projectsSettings) {
        if (settings instanceof ExternalProjectSettings projectSettings) {
          result.put(projectSettings.getExternalProjectPath(), Pair.create(systemId, projectSettings));
        }
      }
    }

    return result;
  }
private static Map<String, Pair<ProjectSystemId, ExternalProjectSettings>> getLinkedProjects(Project project)