static String toCookieHeader(boolean strict, Collection<? extends Cookie> cookies) {
        requireNonNull(cookies, "cookies");
        checkArgument(!cookies.isEmpty(), "cookies is empty.");
        return ClientCookieEncoder.encode(strict, cookies.iterator());
    }
Encodes the specified {@link Cookie}s into a {@code "Cookie"} header value.

@param strict whether to validate that cookie names and values are in the valid scope
              defined in RFC 6265 and to sort the {@link Cookie}s into order of decreasing path length,
              as specified in RFC 6265. If {@code false}, the {@link Cookie}s are encoded in the order
              in which they are given.
@param cookies the {@link Cookie}s to encode.
@return the encoded {@code "Cookie"} header value.

@throws IllegalArgumentException if {@code cookies} is empty.
core/src/main/java/com/linecorp/armeria/common/Cookie.java