@Test
public void testCookieNameStartingWithDollarSign() throws Exception {

    Header header = new BasicHeader("Set-Cookie", "$invalid_name=");
    CookieSpec cookiespec = new BrowserCompatSpec();
    CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/", false);
    List<Cookie> cookies = cookiespec.parse(header, origin);
    for (int i = 0; i < cookies.size(); i++) {
        cookiespec.validate(cookies.get(i), origin);
    }
    Assert.assertNotNull(cookies);
    Assert.assertEquals(1, cookies.size());
}