@Test public void makesItEasyToGetTheCookiesByName() { final Cookie nameCookie = new Cookie("name", "ralph"); RequestHeader testSubject = new RequestHeader( new CookieField( nameCookie, new Cookie("age", "21") ) ); List<Cookie> results = testSubject.cookiesNamed("name"); assertNotNull(results); assertEquals(1, results.size()); assertTrue(results.get(0) == nameCookie); }
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();  }