@Test
public void testSetCookie2OverrideSetCookie() throws Exception {

    HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
    response.addHeader(SM.SET_COOKIE, "name1=value1");
    response.addHeader(SM.SET_COOKIE2, "name1=value2; Version=1");
    HttpContext context = new BasicHttpContext();
    context.setAttribute(ClientContext.COOKIE_ORIGIN, this.cookieOrigin);
    context.setAttribute(ClientContext.COOKIE_SPEC, this.cookieSpec);
    context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
    HttpResponseInterceptor interceptor = new ResponseProcessCookies();
    interceptor.process(response, context);
    List<Cookie> cookies = this.cookieStore.getCookies();
    Assert.assertNotNull(cookies);
    Assert.assertEquals(1, cookies.size());
    Cookie cookie = cookies.get(0);
    Assert.assertEquals(1, cookie.getVersion());
    Assert.assertEquals("name1", cookie.getName());
    Assert.assertEquals("value2", cookie.getValue());
    Assert.assertEquals("localhost.local", cookie.getDomain());
    Assert.assertEquals("/", cookie.getPath());
}