### Question:
ResourceDownloadUtils { public static void addCachingHeaders(final HttpServletResponse httpServletResponse, final String... cacheControls) { if (!Boolean.getBoolean("maera.disable.caches")) { httpServletResponse.setDateHeader("Expires", System.currentTimeMillis() + TEN_YEARS); httpServletResponse.setHeader("Cache-Control", "max-age=" + TEN_YEARS); for (final String cacheControl : cacheControls) { httpServletResponse.addHeader("Cache-Control", cacheControl); } } }  @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 testAddCachingHeadersWithCacheControls() { 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("private"))); mockResponse.expect("addHeader", C.args(C.eq(CACHE_CONTROL), C.eq("foo"))); ResourceDownloadUtils.addCachingHeaders((HttpServletResponse) mockResponse.proxy(), "private", "foo"); }