### Question:
Cookie { @Override public String toString() { StringBuilder result = new StringBuilder(); result.append(name); result.append('='); result.append(value); if (persistent) { if (expiresAt == Long.MIN_VALUE) { result.append("; max-age=0"); } else { result.append("; expires=").append(STANDARD_DATE_FORMAT.format(new Date(expiresAt))); } } if (!hostOnly) { result.append("; domain="); result.append(domain); } result.append("; path=").append(path); if (secure) { result.append("; secure"); } if (httpOnly) { result.append("; httponly"); } return result.toString(); } private  Cookie(String name, String value, long expiresAt, String domain, String path,
                   boolean secure, boolean httpOnly, boolean hostOnly, boolean persistent); private  Cookie(Builder builder); String getName(); String getValue(); boolean getPersistent(); long getExpiresAt(); boolean getHostOnly(); String getDomain(); String getPath(); boolean getHttpOnly(); boolean getSecure(); static List<Cookie> parseAll(List<String> cookieStrings); static Cookie parse(String setCookie); @Override String toString(); boolean similarTo(Cookie other); @Override boolean equals(Object other); @Override int hashCode();  }### Answer:
@Test public void builderExpiresAt() throws Exception { Cookie cookie = new Cookie.Builder() .name("a") .value("b") .hostOnlyDomain("example.com") .expiresAt(date("1970-01-01T00:00:01.000+0000").getTime()) .build(); assertThat(cookie.toString()).isEqualTo( "a=b; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/"); }
@Test public void builderClampsMinDate() throws Exception { Cookie cookie = new Cookie.Builder() .name("a") .value("b") .hostOnlyDomain("example.com") .expiresAt(date("1970-01-01T00:00:00.000+0000").getTime()) .build(); assertThat(cookie.toString()).isEqualTo("a=b; max-age=0; path=/"); }
@Test public void builderClampsMaxDate() throws Exception { Cookie cookie = new Cookie.Builder() .name("a") .value("b") .hostOnlyDomain("example.com") .expiresAt(Long.MAX_VALUE) .build(); assertThat(cookie.toString()).isEqualTo( "a=b; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/"); }