CacheableHttpServletResponse extends HttpServletResponseWrapper { public boolean isValid() { return tx != null ? tx.isValid() : false; } CacheableHttpServletResponse(HttpServletResponse response); CacheTransaction startTransaction(CacheHandle handle,
      StreamFilter filter); @Override PrintWriter getWriter(); @Override ServletOutputStream getOutputStream(); boolean isValid(); CacheTransaction getTransaction(); @Override void setContentType(String type); @Override void flushBuffer(); @Override void addHeader(String name, String value); @Override void setHeader(String name, String value); @Override void addDateHeader(String name, long date); @Override void addIntHeader(String name, int value); @Override void setDateHeader(String name, long date); @Override void setIntHeader(String name, int value);  }
@Test public void testIsValid() { assertFalse(response.isValid()); response.startTransaction(handle, null); assertTrue(response.isValid()); }