@Test public void getCookieByNameWhenOtherHeaderFieldsArePresent() { final Cookie jalapenoCookie = new Cookie("jalapenoCookie", "isTotallyFake"); final CookieField cookieField = new CookieField(jalapenoCookie); final GenericHeaderField justAnotherHeaderField = new GenericHeaderField("aName", "aValue"); RequestHeader requestHeader = new RequestHeader(cookieField, justAnotherHeaderField); List<Cookie> results = requestHeader.cookiesNamed("jalapenoCookie"); assertNotNull(results); assertEquals(1, results.size()); assertEquals(jalapenoCookie, results.get(0)); }
public List<Cookie> cookiesNamed(final String name) { return allCookies().filter(new Fn<Cookie, Boolean>() { @Override public Boolean exec(Cookie in) { return in.name.equals(name); } }).toList(); }
RequestHeader extends Header { public List<Cookie> cookiesNamed(final String name) { return allCookies().filter(new Fn<Cookie, Boolean>() { @Override public Boolean exec(Cookie in) { return in.name.equals(name); } }).toList(); } }
RequestHeader extends Header { public List<Cookie> cookiesNamed(final String name) { return allCookies().filter(new Fn<Cookie, Boolean>() { @Override public Boolean exec(Cookie in) { return in.name.equals(name); } }).toList(); } RequestHeader();  RequestHeader(HeaderField ... fields);  RequestHeader(List<HeaderField> fields); }
RequestHeader extends Header { public List<Cookie> cookiesNamed(final String name) { return allCookies().filter(new Fn<Cookie, Boolean>() { @Override public Boolean exec(Cookie in) { return in.name.equals(name); } }).toList(); } RequestHeader();  RequestHeader(HeaderField ... fields);  RequestHeader(List<HeaderField> fields); AuthorizationField authorization(); List<Cookie> cookiesNamed(final String name); List<Cookie> cookies(); }
RequestHeader extends Header { public List<Cookie> cookiesNamed(final String name) { return allCookies().filter(new Fn<Cookie, Boolean>() { @Override public Boolean exec(Cookie in) { return in.name.equals(name); } }).toList(); } RequestHeader();  RequestHeader(HeaderField ... fields);  RequestHeader(List<HeaderField> fields); AuthorizationField authorization(); List<Cookie> cookiesNamed(final String name); List<Cookie> cookies();  }