@Test public void testGetCookies() throws Exception { List<Cookie> ningCookies = new ArrayList<>(); ningCookies.add(Cookie.newValidCookie( "cookie1_name", "cookie1_value", false, null, "cookie1_path", 1, true, true )); ningCookies.add(Cookie.newValidCookie( "cookie2_name", "cookie2_value", false, null, "cookie2_path", 2, false, false )); List<NewCookie> cookies = ParsecHttpUtil.getCookies(ningCookies); assertEquals(2, cookies.size()); NewCookie cookie1 = cookies.get(0); assertEquals("cookie1_name", cookie1.getName()); assertEquals("cookie1_value", cookie1.getValue()); assertEquals(null, cookie1.getDomain()); assertEquals("cookie1_path", cookie1.getPath()); assertEquals(null, cookie1.getExpiry()); assertEquals(1, cookie1.getMaxAge()); assertTrue(cookie1.isSecure()); assertTrue(cookie1.isHttpOnly()); NewCookie cookie2 = cookies.get(1); assertEquals("cookie2_name", cookie2.getName()); assertEquals("cookie2_value", cookie2.getValue()); assertEquals(null, cookie2.getDomain()); assertEquals("cookie2_path", cookie2.getPath()); assertEquals(null, cookie2.getExpiry()); assertEquals(2, cookie2.getMaxAge()); assertFalse(cookie2.isSecure()); assertFalse(cookie2.isHttpOnly()); }
public static List<NewCookie> getCookies(final Collection<Cookie> ningCookies) { Stream<NewCookie> s = ningCookies.stream().map(ParsecHttpUtil::getCookie); return s.collect(Collectors.toList()); }
ParsecHttpUtil { public static List<NewCookie> getCookies(final Collection<Cookie> ningCookies) { Stream<NewCookie> s = ningCookies.stream().map(ParsecHttpUtil::getCookie); return s.collect(Collectors.toList()); } }
ParsecHttpUtil { public static List<NewCookie> getCookies(final Collection<Cookie> ningCookies) { Stream<NewCookie> s = ningCookies.stream().map(ParsecHttpUtil::getCookie); return s.collect(Collectors.toList()); } private  ParsecHttpUtil(); }
ParsecHttpUtil { public static List<NewCookie> getCookies(final Collection<Cookie> ningCookies) { Stream<NewCookie> s = ningCookies.stream().map(ParsecHttpUtil::getCookie); return s.collect(Collectors.toList()); } private  ParsecHttpUtil(); static List<NewCookie> getCookies(final Collection<Cookie> ningCookies); static NewCookie getCookie(final Cookie ningCookie); static Map<String, List<String>> getParamsMap(final List<Param> ningParams); static Response getResponse(final com.ning.http.client.Response ningResponse); static String parseCharsetFromContentType(String contentType, String defaultCharset); }
ParsecHttpUtil { public static List<NewCookie> getCookies(final Collection<Cookie> ningCookies) { Stream<NewCookie> s = ningCookies.stream().map(ParsecHttpUtil::getCookie); return s.collect(Collectors.toList()); } private  ParsecHttpUtil(); static List<NewCookie> getCookies(final Collection<Cookie> ningCookies); static NewCookie getCookie(final Cookie ningCookie); static Map<String, List<String>> getParamsMap(final List<Param> ningParams); static Response getResponse(final com.ning.http.client.Response ningResponse); static String parseCharsetFromContentType(String contentType, String defaultCharset);  }