### Question:
CookieUtil { public static int dropCookies(final HttpServletRequest request, final HttpServletResponse response, final String cookiePath, final String... cookieNames) { int count = 0; if (cookieNames == null) { return count; } final List<Cookie> cookies = new ArrayList<Cookie>(); for (final String cookieName : cookieNames) { cookies.add(getCookie(request, cookieName)); } return dropCookies(response, cookies.toArray(new Cookie[cookies.size()]), cookiePath); } private  CookieUtil(); static boolean addCookie(final Cookie cookie, final HttpServletResponse response); static Cookie getCookie(final HttpServletRequest request, final String cookieName); static List<Cookie> getCookies(final HttpServletRequest request, final String regex); static boolean extendCookieLife(final HttpServletRequest request, final HttpServletResponse response,
                                           final String cookieName, final String cookiePath, final int expiry); static int dropCookies(final HttpServletRequest request, final HttpServletResponse response, final String cookiePath, final String... cookieNames); static int dropCookiesByRegex(final HttpServletRequest request, final HttpServletResponse response, final String cookiePath, final String... regexes); static int dropCookiesByRegexArray(final HttpServletRequest request, final HttpServletResponse response, final String cookiePath, final String[] regexes); static int dropAllCookies(final HttpServletRequest request, final HttpServletResponse response, final String cookiePath);  }### Answer:
@Test public void testDropCookies() { String[] cookieNames = {"dog-mammal", "cat-mammal"}; CookieUtil.dropCookies(request, response, "/", cookieNames); assertTrue(true); ArgumentCaptor<Cookie> cookieCaptor = ArgumentCaptor.forClass(Cookie.class); verify(response, times(2)).addCookie(cookieCaptor.capture()); for (Cookie cookie : cookieCaptor.getAllValues()) { assertEquals(0, cookie.getMaxAge()); assertEquals("", cookie.getValue()); } }