@Test
public void testParse() throws Exception {

    BasicClientCookie cookie = new BasicClientCookie("name", "value");
    cookie.setDomain(".jp");
    Assert.assertFalse(filter.match(cookie, new CookieOrigin("apache.jp", 80, "/stuff", false)));
    cookie.setDomain(".ac.jp");
    Assert.assertFalse(filter.match(cookie, new CookieOrigin("apache.ac.jp", 80, "/stuff", false)));
    cookie.setDomain(".any.tokyo.jp");
    Assert.assertFalse(filter.match(cookie, new CookieOrigin("apache.any.tokyo.jp", 80, "/stuff", false)));
    // exception
    cookie.setDomain(".metro.tokyo.jp");
    Assert.assertTrue(filter.match(cookie, new CookieOrigin("apache.metro.tokyo.jp", 80, "/stuff", false)));
}