docs: boolean populateMaxDistanceMap(Map<String, Integer> maxDistanceMap, String featureName, int currentDistance, Set<ProvisioningFeatureDefinition> currentStack,
                                     List<MissingRequirement> missingRequirements) {
          ProvisioningFeatureDefinition feature = resolvedFeatures.get(featureName);
          if (!(feature instanceof KernelResolverEsa)) {
              // Feature is already installed
              return true;
          }
  
          if (currentStack.contains(feature)) {
              // We've hit a dependency loop
              return true;
          }
  
          boolean result = true;
  
          currentStack.add(feature);
  
          KernelResolverEsa featureEsa = (KernelResolverEsa) feature;
  
          Integer oldDistance = maxDistanceMap.get(feature.getSymbolicName());
          if (oldDistance == null || oldDistance < currentDistance) {
              maxDistanceMap.put(feature.getSymbolicName(), currentDistance);
          }
  
          for (FeatureResource dependency : feature.getConstituents(SubsystemContentType.FEATURE_TYPE)) {
              ResolvedFeatureSearchResult searchResult = findResolvedDependency(dependency);
  
              if (searchResult.category == ResultCategory.FOUND) {
                  // We found the dependency, continue populating the distance map
                  result &= populateMaxDistanceMap(maxDistanceMap, searchResult.symbolicName, currentDistance + 1, currentStack, missingRequirements);
              } else if (searchResult.category == ResultCategory.MISSING) {
                  // The dependency was totally missing, add it to the list of missing requirements
                  missingRequirements.add(new MissingRequirement(dependency.getSymbolicName(), featureEsa.getResource()));
                  result = false;
              } else {
                  // The dependency was found for another product. That missing requirement is already recorded elsewhere.
                  result = false;
              }
          }
  
          // Find autofeature dependencies
          for (ProvisioningFeatureDefinition dependency : featureEsa.findFeaturesSatisfyingCapability(resolvedFeatures.values())) {
              result &= populateMaxDistanceMap(maxDistanceMap, dependency.getSymbolicName(), currentDistance + 1, currentStack, missingRequirements);
          }
  
          currentStack.remove(feature);
  
          return result;
      }