@Test
public void testToString() throws Exception {

    String expectedString = "Version=2;Application=msf4j;Path=/carbon;Domain=wso2;MaxAge=50;Comment=TestOnly;" +
            "Expires=Sun, 06 Nov 1994 08:49:37 GMT;Secure;HttpOnly";
    Cookie cookie = new NewCookie("Application", "msf4j", "/carbon", "wso2", 2, "TestOnly", 50, new Date
            (784111777000L), true, true);
    CookieHeaderProvider cookieHeaderProvider = new CookieHeaderProvider();
    String cookieString = cookieHeaderProvider.toString(cookie);
    assertNotNull(cookieString);
    assertEquals(cookieString, expectedString);
}