core/play/src/main/java/play/core/cookie/encoding/ClientCookieEncoder.java
public String encode(Iterable<? extends Cookie> cookies) {
    if (cookies == null) {
      throw new NullPointerException("cookies");
    }
    Iterator<? extends Cookie> cookiesIt = cookies.iterator();
    if (!cookiesIt.hasNext()) {
      return null;
    }

    StringBuilder buf = new StringBuilder();
    while (cookiesIt.hasNext()) {
      Cookie c = cookiesIt.next();
      if (c == null) {
        break;
      }

      encode(buf, c);
    }
    return stripTrailingSeparatorOrNull(buf);
  }
public String encode(Iterable<? extends Cookie> cookies) {
    if (cookies == null) {
      throw new NullPointerException("cookies");
    }
    Iterator<? extends Cookie> cookiesIt = cookies.iterator();
    if (!cookiesIt.hasNext()) {
      return null;
    }

    StringBuilder buf = new StringBuilder();
    while (cookiesIt.hasNext()) {
      Cookie c = cookiesIt.next();
      if (c == null) {
        break;
      }

      encode(buf, c);
    }
    return stripTrailingSeparatorOrNull(buf);
  }
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.