code: public static Headers of(Map<String, String> headers) {
          if (headers == null) throw new NullPointerException("headers == null");
  
          // Make a defensive copy and clean it up.
          String[] namesAndValues = new String[headers.size() * 2];
          int i = 0;
          for (Map.Entry<String, String> header : headers.entrySet()) {
              if (header.getKey() == null || header.getValue() == null) {
                  throw new IllegalArgumentException("Headers cannot be null");
              }
              String name = header.getKey().trim();
              String value = header.getValue().trim();
              if (name.length() == 0 || name.indexOf('\0') != -1 || value.indexOf('\0') != -1) {
                  throw new IllegalArgumentException("Unexpected header: " + name + ": " + value);
              }
              namesAndValues[i] = name;
              namesAndValues[i + 1] = value;
              i += 2;
          }
  
          return new Headers(namesAndValues);
      }
docs: Returns headers for the header names and values in the {@link Map}.