code: public String encode(Collection<? extends Cookie> cookies) {
          if (checkNotNull(cookies, "cookies").isEmpty()) {
              return null;
          }
  
          StringBuilder buf = stringBuilder();
          if (strict) {
              if (cookies.size() == 1) {
                  encode(buf, cookies.iterator().next());
              } else {
                  Cookie[] cookiesSorted = cookies.toArray(new Cookie[0]);
                  Arrays.sort(cookiesSorted, COOKIE_COMPARATOR);
                  for (Cookie c : cookiesSorted) {
                      encode(buf, c);
                  }
              }
          } else {
              for (Cookie c : cookies) {
                  encode(buf, c);
              }
          }
          return stripTrailingSeparatorOrNull(buf);
      }
docs: Encodes the specified cookies into a single Cookie header value.
  
  @param cookies
  some cookies
  @return a Rfc6265 style Cookie header value, null if no cookies are passed.