@Test
public void shouldSerializeExpiresBasedOnMaxAge() {

    int maxAgeSeconds = 35;
    Cookie cookie = new Cookie("name", "value");
    cookie.setMaxAge(maxAgeSeconds);
    String serializedCookie = cookieHeaderSerializer.serialize(cookie);
    Date date = new Date(System.currentTimeMillis() + Long.valueOf(maxAgeSeconds) * 1000L);
    String expiresValue = DateUtilities.dateFormat(date);
    assertThat(getExpiresValue(serializedCookie), is(expiresValue));
}