@Test
public void shouldEraseCookieAndRemoveForInvalidatedSession() throws IOException {

    HttpSessionImpl session = new HttpSessionImpl("123", System.currentTimeMillis());
    session.invalidate();
    servletContext.handleSession(session, response);
    verify(sessionStorage, times(1)).removeSession(session);
    assertThat(response.getCookies().size(), is(greaterThan(0)));
    for (Cookie cookie : response.getCookies()) {
        if (cookie.getName().equals(HttpSessionImpl.COOKIE_NAME)) {
            assertThat(cookie.getMaxAge(), lessThan(-1));
            return;
        }
    }
    fail("Session DELETE cookie was not set.");
}