### Question:
PortalCookies { public Cookie getCookie(HttpServletRequest request, String name) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (Cookie cookie : cookies) { if (cookie.getName().equals(name)) { return cookie; } } } return null; }  void addCSRFTokenCookieToResponse(HttpServletRequest request, HttpServletResponse res, Object apiTokenFromClient); void invalidateRootCookie(HttpServletResponse res, Cookie cookie, String path); boolean isCSRFTokenCookieSecure(); void addTenantCookieToResponse(HttpServletResponse response, Long tenantId); String getTenantCookieFromRequest(HttpServletRequest request); Cookie getCookie(HttpServletRequest request, String name);  }### Answer:
@Test public void should_get_cookie_by_name_from_request() throws Exception { Cookie cookie = new Cookie("bonita.tenant", "123"); request.setCookies(cookie); Cookie fetchedCookie = portalCookies.getCookie(request, "bonita.tenant"); assertThat(fetchedCookie).isEqualTo(cookie); }