docs: public static void mergeExternalCSSAndJSNodes (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
                                                   @Nonnull final HCHead aHead,
                                                   final boolean bMergeCSS,
                                                   final boolean bMergeJS,
                                                   @Nonnull final IWebSiteResourceBundleProvider aWSRBMgr)
    {
      if (!bMergeCSS && !bMergeJS)
      {
        // Nothing to do
        return;
      }
  
      final boolean bRegular = HCSettings.isUseRegularResources ();
  
      if (bMergeCSS)
      {
        // Extract all CSS nodes for merging
        final ICommonsList <IHCNode> aCSSNodes = new CommonsArrayList <> ();
        aHead.getAllAndRemoveAllCSSNodes (aCSSNodes);
  
        final ICommonsList <WebSiteResourceWithCondition> aCSSs = new CommonsArrayList <> ();
        for (final IHCNode aNode : aCSSNodes)
        {
          boolean bStartMerge = true;
          if (HCCSSNodeDetector.isDirectCSSFileNode (aNode))
          {
            final ICSSPathProvider aPathProvider = ((HCLink) aNode).getPathProvider ();
            if (aPathProvider != null)
            {
              aCSSs.add (WebSiteResourceWithCondition.createForCSS (aPathProvider, bRegular));
              bStartMerge = false;
            }
          }
  
          if (bStartMerge)
          {
            if (!aCSSs.isEmpty ())
            {
              for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aCSSs, bRegular))
                aHead.addCSS (aBundle.createNode (aRequestScope));
              aCSSs.clear ();
            }
  
            // Add the current (non-mergable) node again to head after merging
            aHead.addCSS (aNode);
          }
        }
  
        // Add the remaining nodes (if any)
        if (!aCSSs.isEmpty ())
          for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aCSSs, bRegular))
            aHead.addCSS (aBundle.createNode (aRequestScope));
      }
  
      if (bMergeJS)
      {
        // Extract all JS nodes for merging
        final ICommonsList <IHCNode> aJSNodes = new CommonsArrayList <> ();
        aHead.getAllAndRemoveAllJSNodes (aJSNodes);
  
        final ICommonsList <WebSiteResourceWithCondition> aJSs = new CommonsArrayList <> ();
        for (final IHCNode aNode : aJSNodes)
        {
          boolean bStartMerge = true;
          if (HCJSNodeDetector.isDirectJSFileNode (aNode))
          {
            final IJSPathProvider aPathProvider = ((HCScriptFile) aNode).getPathProvider ();
            if (aPathProvider != null)
            {
              aJSs.add (WebSiteResourceWithCondition.createForJS (aPathProvider, bRegular));
              bStartMerge = false;
            }
          }
  
          if (bStartMerge)
          {
            if (!aJSs.isEmpty ())
            {
              for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aJSs, bRegular))
                aHead.addJS (aBundle.createNode (aRequestScope));
              aJSs.clear ();
            }
  
            // Add the current (non-mergable) node again to head after merging
            aHead.addJS (aNode);
          }
        }
  
        // Add the remaining nodes (if any)
        if (!aJSs.isEmpty ())
          for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aJSs, bRegular))
            aHead.addJS (aBundle.createNode (aRequestScope));
      }
    }