### Question:
ResourceDownloadUtils { public static void addPublicCachingHeaders(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse) { addCachingHeaders(httpServletResponse, "public"); }  @Deprecated static void serveFileImpl(final HttpServletResponse httpServletResponse, final InputStream in); static void addCachingHeaders(final HttpServletResponse httpServletResponse, final String... cacheControls); @Deprecated static void addCachingHeaders(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse); static void addPublicCachingHeaders(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse); static void addPrivateCachingHeaders(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse);  }### Answer:
@Test public void testAddPublicCachingHeaders() { Mock mockRequest = new Mock(HttpServletRequest.class); Mock mockResponse = new Mock(HttpServletResponse.class); mockResponse.expect("setDateHeader", C.ANY_ARGS); mockResponse.expect("setHeader", C.args(C.eq(CACHE_CONTROL), C.eq("max-age=" + TEN_YEARS))); mockResponse.expect("addHeader", C.args(C.eq(CACHE_CONTROL), C.eq("public"))); ResourceDownloadUtils.addPublicCachingHeaders((HttpServletRequest) mockRequest.proxy(), (HttpServletResponse) mockResponse.proxy()); }