class SessionHelpers {

  @SuppressWarnings("unchecked")
  public void interceptHttpListener(EventListener caller, HttpSessionEvent event) {
    if (event.getSession() instanceof RepositoryBackedHttpSession) {
      return;
    }
    Object value = event.getSession().getServletContext().getAttribute(INTROSPECTING_LISTENERS);
    if (value != null && !((Set<?>)value).contains(caller)) {
      ((Set<Object>)value).add(caller);
      onAddListener(event.getSession().getServletContext(), caller);
    }
  }

}