@Test
public void shouldRemoveExpiredSession() throws IOException {

    HttpSessionImpl session = new HttpSessionImpl("123", System.currentTimeMillis());
    session.setLastAccessedTime(System.currentTimeMillis() - session.getMaxInactiveInterval() * 1000 - 1);
    when(sessionStorage.getSession("123")).thenReturn(session);
    HttpSessionImpl sessionRead = servletContext.getSession("123");
    verify(sessionStorage, times(1)).removeSession(session);
    assertThat(sessionRead, is(nullValue()));
}