### Question:
WrappedHttpServletResponse implements Response { @Override public void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly) { Cookie cookie = new Cookie(name, value); if (path != null) { cookie.setPath(path); } if (domain != null) { cookie.setDomain(domain); } cookie.setMaxAge(maxAge); cookie.setSecure(secure); this.setHttpOnly(cookie, httpOnly); response.addCookie(cookie); } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly); @Override void setStatus(int status); @Override void addHeader(String name, String value); @Override void setHeader(String name, String value); @Override OutputStream getOutputStream(); @Override void sendError(int code); @Override void sendError(int code, String message); @Override void end();  }### Answer:
@Test public void testSetCookie() throws Exception { int maxAge = 300; response.setCookie(COOKIE_NAME, COOKIE_VALUE, COOKIE_PATH, COOKIE_DOMAIN, maxAge, false, true); verify(mockResponse).addCookie(any(Cookie.class)); assertEquals(COOKIE_NAME, mockResponse.getCookie(COOKIE_NAME).getName()); assertEquals(COOKIE_PATH, mockResponse.getCookie(COOKIE_NAME).getPath()); assertEquals(COOKIE_DOMAIN, mockResponse.getCookie(COOKIE_NAME).getDomain()); assertEquals(maxAge, mockResponse.getCookie(COOKIE_NAME).getMaxAge()); assertEquals(COOKIE_VALUE, mockResponse.getCookie(COOKIE_NAME).getValue()); assertEquals(true, mockResponse.getCookie(COOKIE_NAME).isHttpOnly()); }