@Test
public void testCookieWithComma() throws Exception {

    Header header = new BasicHeader("Set-Cookie", "name=value; expires=\"Thu, 01-Jan-1970 00:00:00 GMT");
    CookieSpec cookiespec = new BrowserCompatSpec();
    CookieOrigin origin = new CookieOrigin("localhost", 80, "/", false);
    try {
        List<Cookie> cookies = cookiespec.parse(header, origin);
        for (int i = 0; i < cookies.size(); i++) {
            cookiespec.validate(cookies.get(i), origin);
        }
        Assert.fail("MalformedCookieException should have been thrown");
    } catch (MalformedCookieException expected) {
    }
}