Header header = new BasicHeader("Set-Cookie2", "name=value;Comment=\"good cookie\";" +
"CommentURL=\"www.domain.com/goodcookie/\";Secure;Version=1");
List<Cookie> cookies = cookiespec.parse(header, origin);
assertNotNull(cookies);
assertEquals(1, cookies.size());
ClientCookie cookie = (ClientCookie) cookies.get(0);
assertEquals("good cookie", cookie.getComment());
assertEquals("www.domain.com/goodcookie/", cookie.getCommentURL());
assertTrue(cookie.isSecure());
// Comment, CommentURL, Secure are OPTIONAL
header = new BasicHeader("Set-Cookie2", "name=value;Version=1");
cookies = cookiespec.parse(header, origin);
assertNotNull(cookies);
assertEquals(1, cookies.size());
cookie = (ClientCookie) cookies.get(0);
assertFalse(cookie.isSecure());
}