docs: private void restoreRequestAttributesAfterInclude(Invocation inv) {
          logger.debug("Restoring snapshot of request attributes after include");
          HttpServletRequest request = inv.getRequest();
  
          @SuppressWarnings("unchecked")
          Map<String, Object> attributesSnapshot = (Map<String, Object>) inv
                  .getAttribute("$$paoding-rose.attributesBeforeInclude");
  
          // Need to copy into separate Collection here, to avoid side effects
          // on the Enumeration when removing attributes.
          Set<String> attrsToCheck = new HashSet<String>();
          Enumeration<?> attrNames = request.getAttributeNames();
          while (attrNames.hasMoreElements()) {
              String attrName = (String) attrNames.nextElement();
              attrsToCheck.add(attrName);
          }
  
          // Iterate over the attributes to check, restoring the original value
          // or removing the attribute, respectively, if appropriate.
          for (String attrName : attrsToCheck) {
              Object attrValue = attributesSnapshot.get(attrName);
              if (attrValue != null) {
                  if (logger.isDebugEnabled()) {
                      logger.debug("Restoring original value of attribute [" + attrName
                              + "] after include");
                  }
                  request.setAttribute(attrName, attrValue);
              } else {
                  if (logger.isDebugEnabled()) {
                      logger.debug("Removing attribute [" + attrName + "] after include");
                  }
                  request.removeAttribute(attrName);
              }
          }
  
      }