@Test
public void retainAll() throws Exception {

    CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie);
    List<Cookie> content = Arrays.asList(cookie, brownieCookie);
    boolean modified = cookies.retainAll(content);
    Assert.assertTrue(modified);
    Assert.assertEquals(2, cookies.size());
    Assert.assertTrue(cookies.containsAll(content));
    Assert.assertFalse(cookies.contains(cupsCookie));
    Assert.assertFalse(cookies.retainAll(content));
}