code: private StringBuilder appendMapAsString(StringBuilder messageBuilder, Map<String, Object> map) {
      for (Entry<String, Object> mapEntry : map.entrySet()) {
        Object headerValue = mapEntry.getValue();
        // Perform a case-insensitive check if the header should be scrubbed.
        if (SCRUBBED_HEADERS.contains(mapEntry.getKey().toLowerCase())) {
          headerValue = REDACTED_HEADER;
        }
        messageBuilder.append(String.format("%s: %s%n", mapEntry.getKey(), headerValue));
      }
      return messageBuilder;
    }
docs: Converts the map of key/value pairs to a multi-line string (one line per key). Masks sensitive
  information for a predefined set of header keys.
  
  @param map a non-null Map
  @return a non-null String