code: public String canonicalizedHeadersString(Map<String, String> headers) {
          List<Map.Entry<String, String>> sortedList = getSortedMapEntries(headers);
  
          String header;
          String headerValue;
          StringBuilder headerString = new StringBuilder();
  
          for (Map.Entry<String, String> ent : sortedList) {
              header = nullToEmpty(ent.getKey()).toLowerCase();
              headerValue = nullToEmpty(ent.getValue()).trim();
              headerString.append(header).append(COLON).append(headerValue).append(LINE_SEPARATOR);
          }
  
          return headerString.toString();
      }
docs: Canonicalized (standardized) headers string is formed by first sorting all the header
  parameters, then converting all header names to lowercase and
  trimming excess white space characters out of the header values
  
  @param headers Headers to be canonicalized.
  @return A canonicalized form for the specified headers.