### Question:
Cookies { public List<HttpCookie> get(String needle) { return getAll() .stream() .filter(c -> c.getName().equalsIgnoreCase(needle)) .collect(Collectors.toList()); } private  Cookies(HttpRequest request); static Cookies of(HttpRequest request); List<HttpCookie> getAll(); List<HttpCookie> get(String needle); void set(HttpCookie cookie); void remove(String cookie);  }### Answer:
@Test void givenRequestWithCookieHeader_whenGetCookie_thenRetrievesCookies() { doReturn(new Header[] {cookieMultiple, cookieApiml}).when(request).getHeaders(HttpHeaders.COOKIE); HttpCookie testCookie = new HttpCookie("cookie1", "cookie1"); assertThat(underTest.get("cookie1"), hasItem(testCookie)); }