### Question:
CookieSpecBuilder { public String build() { List<String> builder = new ArrayList<>(); builder.add(String.format("%s=%s", getKey(), getValue())); if (hasText(getPath())) { builder.add(String.format("Path=%s", getPath())); } if (Objects.equals(Boolean.TRUE, getHttpOnly())) { builder.add("HttpOnly"); } if (hasText(getSameSite())) { builder.add(String.format("SameSite=%s", getSameSite())); } if (Objects.equals(Boolean.TRUE, getSecure())) { builder.add("Secure"); } if (getMaxAge() > 0) { builder.add(String.format("Max-Age=%s", getMaxAge())); } if (getExpires() != null) { builder.add(String.format("Expires=%s", makeExpires())); } return builder.stream().collect(Collectors.joining("; ")); } CookieSpecBuilder(String key, String value); CookieSpecBuilder setPath(String path); CookieSpecBuilder setHttpOnly(Boolean httpOnly); CookieSpecBuilder setSameSite(String s); CookieSpecBuilder sameSiteStrict(); CookieSpecBuilder setSecure(Boolean s); CookieSpecBuilder setExpires(LocalDateTime expires); CookieSpecBuilder setMaxAge(int maxAge); String build(); String getKey(); String getValue(); String getPath(); Boolean getHttpOnly(); String getSameSite(); Boolean getSecure(); LocalDateTime getExpires(); int getMaxAge();  }### Answer:
@Test public void shouldBeOk_whenHaveOnlyKeyValue() { String output = new CookieSpecBuilder("X-CSRF-Token", "xyz").build(); String expected = "X-CSRF-Token=xyz; Path=/; HttpOnly"; assertThat(output).isEqualTo(expected); }