static List<String> toSetCookieHeaders(ImmutableList.Builder<String> builder,
                                           boolean strict, Iterator<? extends Cookie> it) {
        assert it.hasNext();
        do {
            final Cookie c = it.next();
            requireNonNull(c, "cookies contains null.");
            builder.add(c.toSetCookieHeader(strict));
        } while (it.hasNext());

        return builder.build();
    }
Strips out the trailing 2-char separator from the specified {@link StringBuilder}.

@param buf a buffer where some cookies were encoded.
@return the {@link String} without the trailing separator
core/src/main/java/com/linecorp/armeria/common/CookieUtil.java