@Test
    void requireThatAccessorsWork() {
        final Cookie cookie = new Cookie();
        cookie.setName("foo");
        assertEquals("foo", cookie.getName());
        cookie.setName("bar");
        assertEquals("bar", cookie.getName());

        cookie.setValue("foo");
        assertEquals("foo", cookie.getValue());
        cookie.setValue("bar");
        assertEquals("bar", cookie.getValue());

        cookie.setDomain("foo");
        assertEquals("foo", cookie.getDomain());
        cookie.setDomain("bar");
        assertEquals("bar", cookie.getDomain());

        cookie.setPath("foo");
        assertEquals("foo", cookie.getPath());
        cookie.setPath("bar");
        assertEquals("bar", cookie.getPath());

        cookie.setMaxAge(69, TimeUnit.DAYS);
        assertEquals(69, cookie.getMaxAge(TimeUnit.DAYS));
        assertEquals(TimeUnit.DAYS.toHours(69), cookie.getMaxAge(TimeUnit.HOURS));

        cookie.setSecure(true);
        assertTrue(cookie.isSecure());
        cookie.setSecure(false);
        assertFalse(cookie.isSecure());

        cookie.setHttpOnly(true);
        assertTrue(cookie.isHttpOnly());
        cookie.setHttpOnly(false);
        assertFalse(cookie.isHttpOnly());
    }
@author Simon Thoresen Hult
@author bjorncs
container-core/src/test/java/com/yahoo/jdisc/http/CookieTestCase.java