### Question:
RFC6265CookieSpec implements CookieSpec { @Override public final void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); Args.notNull(origin, "Cookie origin"); for (final CookieAttributeHandler handler: this.attribHandlers) { handler.validate(cookie, origin); } } protected  RFC6265CookieSpec(final CommonCookieAttributeHandler... handlers); @Override final List<Cookie> parse(final Header header, final CookieOrigin origin); @Override final void validate(final Cookie cookie, final CookieOrigin origin); @Override final boolean match(final Cookie cookie, final CookieOrigin origin); @Override List<Header> formatCookies(final List<Cookie> cookies);  }### Answer:
@Test public void testValidateCookieBasics() throws Exception { final CommonCookieAttributeHandler h1 = Mockito.mock(CommonCookieAttributeHandler.class); Mockito.when(h1.getAttributeName()).thenReturn("this"); final CommonCookieAttributeHandler h2 = Mockito.mock(CommonCookieAttributeHandler.class); Mockito.when(h2.getAttributeName()).thenReturn("that"); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(h1, h2); final CookieOrigin origin = new CookieOrigin("host", 80, "/path/", true); final BasicClientCookie cookie = new BasicClientCookie("name", "value"); cookiespec.validate(cookie, origin); Mockito.verify(h1).validate(cookie, origin); Mockito.verify(h2).validate(cookie, origin); }