code: private void fixSurrogateMap(LinkedHashMap<String, List<String>> targetCapabilities, String currentSurrogate) {
          boolean esiEnabledInEsigate = false;
  
          // Check if Esigate will perform ESI.
          for (String c : Esi.CAPABILITIES) {
              if (targetCapabilities.get(currentSurrogate).contains(c)) {
                  esiEnabledInEsigate = true;
                  break;
              }
          }
  
          if (esiEnabledInEsigate) {
              // Ensure all Esi capabilities are executed by our instance.
              for (String c : Esi.CAPABILITIES) {
                  for (String device : targetCapabilities.keySet()) {
                      if (device.equals(currentSurrogate)) {
                          if (!targetCapabilities.get(device).contains(c)) {
                              targetCapabilities.get(device).add(c);
                          }
                      } else {
                          targetCapabilities.get(device).remove(c);
                      }
  
                  }
              }
  
          }
  
      }
docs: The current implementation of ESI cannot execute rules partially. For instance if ESI-Inline is requested, ESI,
  ESI-Inline, X-ESI-Fragment are executed.
  
  <p>
  This method handles this specific case : if one requested capability enables the Esi extension in this instance,
  all other capabilities are moved to this instance. This prevents broken behavior.
  
  
  @see Esi
  @see org.esigate.extension.Esi
  
  @param targetCapabilities
  @param currentSurrogate
  the current surrogate id.