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

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

    List<String> encoded = new ArrayList<String>();
    for (Cookie c : cookies) {
      if (c == null) {
        break;
      }
      encoded.add(encode(c));
    }
    return encoded;
  }
public List < String > encode ( Iterable < ? extends Cookie > cookies ) { if ( cookies == null ) { throw new NullPointerException ( "cookies" ) ; } if ( cookies . iterator ( ) . hasNext ( ) ) { return Collections . emptyList ( ) ; } List < String > encoded = new ArrayList < String > ( ) ; 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
Batch encodes cookies into Set - Cookie header values .