core/play/src/main/java/play/core/cookie/encoding/ServerCookieEncoder.java
public List<String> encode(Cookie... cookies) {
    if (cookies == null) {
      throw new NullPointerException("cookies");
    }
    if (cookies.length == 0) {
      return Collections.emptyList();
    }

    List<String> encoded = new ArrayList<String>(cookies.length);
    for (Cookie c : cookies) {
      if (c == null) {
        break;
      }
      encoded.add(encode(c));
    }
    return encoded;
  }
public List<String> encode(Cookie... cookies) {
    if (cookies == null) {
      throw new NullPointerException("cookies");
    }
    if (cookies.length == 0) {
      return Collections.emptyList();
    }

    List<String> encoded = new ArrayList<String>(cookies.length);
    for (Cookie c : cookies) {
      if (c == null) {
        break;
      }
      encoded.add(encode(c));
    }
    return encoded;
  }
Batch encodes cookies into Set-Cookie header values.

@param cookies a bunch of cookies
@return the corresponding bunch of Set-Cookie headers