DefaultHttpRequest nettyRequest = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "");
String cookie1Name = "PREF";
String cookie1Value = "ID=a95756377b78e75e:FF=0:TM=1392709628:LM=1392709628:S=a5mOVvTB7DBkexgi";
String cookie1Domain = ".google.com";
String cookie1Path = "/";
Cookie cookie = new DefaultCookie(cookie1Name, cookie1Value);
cookie.setPath(cookie1Path);
cookie.setDomain(cookie1Domain);
new HttpClientRequest<ByteBuf>(nettyRequest).withCookie(cookie);
String cookieHeader = nettyRequest.headers().get(HttpHeaders.Names.COOKIE);
Assert.assertNotNull("No cookie header found.", cookieHeader);
Set<Cookie> decodeCookies = CookieDecoder.decode(cookieHeader);
Assert.assertNotNull("No cookie found with name.", decodeCookies);