class CookieHeaderDelegate implements RuntimeDelegate.HeaderDelegate<Cookie> {

    @Override
    public Cookie fromString(String header) {
        if (header == null) {
            throw new IllegalArgumentException();
        }

        List<Cookie> cookies = HeaderHelper.parseCookies(header);
        return Iterables.getFirst(cookies, null);
    }

}