private static void forgetExternalProjectsClasspath(@NotNull ProjectSystemId myExternalSystemId,
                                                      @NotNull Project project,
                                                      @NotNull Set<String> linkedProjectPathsToForget) {
    modifyWorkspaceModel(
      project,
      ExternalSystemBundle.message("external.system.local.settings.workspace.model.project.unlink.title"),
      "ForgetExternalProjects update",
      storage -> {
        Sequence<ExternalProjectsBuildClasspathEntity> currentEntities = storage.entities(ExternalProjectsBuildClasspathEntity.class);
        Iterator<ExternalProjectsBuildClasspathEntity> entityIterator = currentEntities.iterator();
        if (!entityIterator.hasNext()) {
          return;
        }
        modifyExternalProjectsBuildClasspathEntity(storage, entityIterator.next(), modifiableEntity -> {
          Map<String, ExternalProjectBuildClasspathEntity> classpath = modifiableEntity.getProjectsBuildClasspath();
          Iterator<Map.Entry<String, ExternalProjectBuildClasspathEntity>> classpathIterator = classpath.entrySet().iterator();
          while (classpathIterator.hasNext()) {
            Map.Entry<String, ExternalProjectBuildClasspathEntity> entry = classpathIterator.next();
            if (linkedProjectPathsToForget.contains(entry.getKey()) ||
                linkedProjectPathsToForget.contains(getRootProjectPath(entry.getKey(), myExternalSystemId, project))) {
              classpathIterator.remove();
            }
          }
          return null;
        });
      });
  }
private static void forgetExternalProjectsClasspath(@NotNull ProjectSystemId myExternalSystemId,
                                                      @NotNull Project project,
                                                      @NotNull Set<String> linkedProjectPathsToForget)