### Question:
MinijaxServletHttpHeaders extends MinijaxHttpHeaders { @Override public Map<String, Cookie> getCookies() { if (cookies == null) { cookies = new HashMap<>(); final javax.servlet.http.Cookie[] servletCookies = request.getCookies(); for (int i = 0; i < servletCookies.length; i++) { final String name = servletCookies[i].getName(); final String value = servletCookies[i].getValue(); cookies.put(name, new Cookie(name, value)); } } return cookies; } MinijaxServletHttpHeaders(final HttpServletRequest request); @Override List<String> getRequestHeader(final String name); @Override String getHeaderString(final String name); @Override MultivaluedMap<String, String> getRequestHeaders(); @Override Map<String, Cookie> getCookies();  }### Answer:
@Test public void testCookies() throws Exception { final javax.servlet.http.Cookie[] servletCookies = new javax.servlet.http.Cookie[] { new javax.servlet.http.Cookie("k", "v") }; final HttpServletRequest request = mock(HttpServletRequest.class); when(request.getCookies()).thenReturn(servletCookies); final MinijaxServletHttpHeaders httpHeaders = new MinijaxServletHttpHeaders(request); final Map<String, Cookie> cookies = httpHeaders.getCookies(); assertNotNull(cookies); assertEquals(1, cookies.size()); assertEquals("v", cookies.get("k").getValue()); assertEquals(cookies, httpHeaders.getCookies()); }