docs: public UninstallationResult calculateUninstallChanges(Set<AddOn> selectedAddOns) {
          List<AddOn> remainingAddOns = new ArrayList<>(installedAddOns.getAddOns());
          remainingAddOns.removeAll(selectedAddOns);
  
          Set<AddOn> uninstallations = new HashSet<>();
          List<AddOn> addOnsToCheck = new ArrayList<>(remainingAddOns);
          while (!addOnsToCheck.isEmpty()) {
              AddOn addOn = addOnsToCheck.remove(0);
              AddOn.AddOnRunRequirements requirements = addOn.calculateRunRequirements(remainingAddOns);
  
              if (!requirements.hasDependencyIssue()) {
                  addOnsToCheck.removeAll(requirements.getDependencies());
              } else if (AddOn.InstallationStatus.UNINSTALLATION_FAILED != addOn.getInstallationStatus()) {
                  uninstallations.add(addOn);
              }
          }
  
          for (Iterator<AddOn> it = uninstallations.iterator(); it.hasNext();) {
              AddOn addOn = it.next();
              if (addOn.calculateRunRequirements(installedAddOns.getAddOns()).hasDependencyIssue()
                      && !containsAny(addOn.getIdsAddOnDependencies(), uninstallations)) {
                  it.remove();
              }
          }
  
          remainingAddOns.removeAll(uninstallations);
          Set<Extension> extensions = new HashSet<>();
          for (AddOn addOn : remainingAddOns) {
              if (addOn.hasExtensionsWithDeps()) {
                  for (Extension ext : addOn.getLoadedExtensions()) {
                      AddOn.AddOnRunRequirements requirements = addOn.calculateExtensionRunRequirements(ext, remainingAddOns);
                      if (!requirements.getExtensionRequirements().isEmpty()) {
                          AddOn.ExtensionRunRequirements extReqs = requirements.getExtensionRequirements().get(0);
                          if (!extReqs.isRunnable()) {
                              extensions.add(ext);
                          }
                      }
                  }
              }
          }
  
          uninstallations.addAll(selectedAddOns);
          return new UninstallationResult(selectedAddOns, uninstallations, extensions);
      }