@Test
public void testFindListenersByIntercepting() {

  HttpServletRequest request = mock(HttpServletRequest.class);
  HttpSession session = mock(HttpSession.class);
  when(request.getSession()).thenReturn(session);
  SessionHelpers.findListenersByIntercepting(servletContext, request);
  ArgumentCaptor<String> attribute = ArgumentCaptor.forClass(String.class);
  verify(session).setAttribute(attribute.capture(), any(String.class));
  verify(session).removeAttribute(attribute.getValue());
  verify(session).invalidate();
  verify(servletContext).setAttribute(SessionHelpers.INTROSPECTING_LISTENERS, Boolean.TRUE);
}