### Question:
ServletUtil { public static void copyToServletResponse( HttpResponse response, HttpServletResponse servletResponse) throws IOException { copyHeadersAndStatusToServletResponse(response, servletResponse); copyContentToServletResponse(response, servletResponse); } private  ServletUtil(); static HttpRequest fromHttpServletRequest(HttpServletRequest servletReq); static void setCachingHeaders(HttpResponseBuilder response, int ttl, boolean noProxy); static void copyToServletResponseAndOverrideCacheHeaders(
      HttpResponse response, HttpServletResponse servletResponse); static void copyToServletResponse(
      HttpResponse response, HttpServletResponse servletResponse); static void copyContentToServletResponse(
      HttpResponse response, HttpServletResponse servletResponse); static void copyHeadersAndStatusToServletResponse(
      HttpResponse response, HttpServletResponse servletResponse); static Uri validateUrl(Uri urlToValidate); static void setXForwardedForHeader(HttpRequest inboundRequest, HttpRequest req); static void setXForwardedForHeader(HttpServletRequest inboundRequest, HttpRequest req); static HttpResponse errorResponse(GadgetException e); static HttpResponse convertToJsonResponse(HttpResponse response); static final String REMOTE_ADDR_KEY; static final String DATA_URI_KEY; }### Answer:
@Test public void testCopyToServletResponse() throws Exception { HttpResponse response = new HttpResponseBuilder() .setResponseString("response string").setHttpStatusCode(200).addHeader("h1", "v1") .addHeader("h2", "v2").addHeader("Cache-Control", "private,no-store,max-age=10") .addHeader("Expires", "123").create(); HttpServletResponse servletResponse = EasyMock.createMock(HttpServletResponse.class); HttpServletResponseRecorder recorder = new HttpServletResponseRecorder(servletResponse); ServletUtil.copyToServletResponse(response, recorder); assertEquals(200, recorder.getHttpStatusCode()); assertEquals("response string", recorder.getResponseAsString()); assertEquals("v1", recorder.getHeader("h1")); assertEquals("v2", recorder.getHeader("h2")); assertEquals("private,no-store,max-age=10", recorder.getHeader("Cache-Control")); assertEquals("123", recorder.getHeader("Expires")); }