@Test
  public void testGetSession2() {
    doFilter();

    HttpSession session1 = ((HttpServletRequest) getFilteredRequest()).getSession();

    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
    Cookie cookie = (Cookie) response.getCookies().get(0);
    getWebMockObjectFactory().getMockRequest().addCookie(cookie);

    doFilter();

    HttpSession session2 = ((HttpServletRequest) getFilteredRequest()).getSession();

    assertEquals("Session objects across requests should be the same", session1, session2);
  }
This servlet tests the effects of the downstream SessionCachingFilter filter. When these tests
are performed, the filter would already have taken effect.
extensions/geode-modules-session/src/integrationTest/java/org/apache/geode/modules/session/internal/filter/CommonTests.java