@Test
public void retrieveUserFromWSSessionWithInvalidatedSession() {

    TestSession session = new TestSession();
    TestHttpSession httpSession = new TestHttpSession();
    TestSUser user = new TestSUser();
    session.getUserProperties().put(HttpSession.class.getName(), httpSession);
    httpSession.setAttribute(WebUtils.DEFAULT_USER_KEY, user);
    httpSession.invalidate();
    assertThat(WebUtils.retrieveUserFromWSSession(session).isPresent()).isFalse();
}