@Test
  public void testIsNew() throws Exception {
    Callback c = (request, response) -> {
      HttpSession session = request.getSession();
      response.getWriter().write(Boolean.toString(session.isNew()));
    };
    servlet.getServletContext().setAttribute("callback", c);

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    req.setParameter("cmd", QueryCommand.CALLBACK.name());
    req.setParameter("param", "callback");

    WebResponse response = wc.getResponse(req);
    assertThat(response.getText()).isEqualTo("true");
    response = wc.getResponse(req);
    assertThat(response.getText()).isEqualTo("false");
  }
Test that calling session.isNew() works for the initial as well as subsequent requests.
extensions/geode-modules-tomcat8/src/distributedTest/java/org/apache/geode/modules/session/TestSessionsTomcat8Base.java