### Question:
Cookies { public List<HttpCookie> getAll() { List<HttpCookie> cookieList = new ArrayList<>(); List<Header> cookieHeaders = getHeader(HttpHeaders.COOKIE); cookieHeaders.forEach(h -> cookieList.addAll(getAllCookiesFromHeader(h))); return cookieList; } 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_whenGetAllCookies_thenRetrievesAllCookies() { doReturn(new Header[] {}).when(request).getHeaders(HttpHeaders.COOKIE); assertThat(underTest.getAll().size(), is(0)); doReturn(new Header[] {cookieMultiple, cookieApiml}).when(request).getHeaders(HttpHeaders.COOKIE); HttpCookie testCookie = new HttpCookie("cookie1", "cookie1"); testCookie.setVersion(0); assertThat(underTest.getAll().size(), is(4)); assertThat(underTest.getAll(), hasItem(testCookie)); }