@Test
public void testNullCookieValueFormatting() {

    BasicClientCookie cookie = new BasicClientCookie("name", null);
    cookie.setDomain(".whatever.com");
    cookie.setAttribute(ClientCookie.DOMAIN_ATTR, cookie.getDomain());
    cookie.setPath("/");
    cookie.setAttribute(ClientCookie.PATH_ATTR, cookie.getPath());
    CookieSpec cookiespec = new BrowserCompatSpec();
    List<Cookie> cookies = new ArrayList<Cookie>(1);
    cookies.add(cookie);
    List<Header> headers = cookiespec.formatCookies(cookies);
    Assert.assertNotNull(headers);
    Assert.assertEquals(1, headers.size());
    Assert.assertEquals("name=", headers.get(0).getValue());
}