@Test public void testGetParams() throws Exception { List<Param> ningParams = new ArrayList<>(); ningParams.add(new Param("key1", "key1_value1")); ningParams.add(new Param("key2", "key2_value1")); Map<String, List<String>> params = ParsecHttpUtil.getParamsMap(ningParams); assertEquals(2, params.size()); assertTrue(params.containsKey("key1") && params.containsKey("key2")); assertEquals("[key1_value1]", params.get("key1").toString()); assertEquals("[key2_value1]", params.get("key2").toString()); }
public static Map<String, List<String>> getParamsMap(final List<Param> ningParams) { Map<String, List<String>> params = new HashMap<>(); for (Param ningParam : ningParams) { String paramKey = ningParam.getName(); List<String> paramValues = (params.containsKey(paramKey)) ? params.get(paramKey) : new ArrayList<>(); paramValues.add(ningParam.getValue()); params.put(paramKey, paramValues); } return params; }
ParsecHttpUtil { public static Map<String, List<String>> getParamsMap(final List<Param> ningParams) { Map<String, List<String>> params = new HashMap<>(); for (Param ningParam : ningParams) { String paramKey = ningParam.getName(); List<String> paramValues = (params.containsKey(paramKey)) ? params.get(paramKey) : new ArrayList<>(); paramValues.add(ningParam.getValue()); params.put(paramKey, paramValues); } return params; } }
ParsecHttpUtil { public static Map<String, List<String>> getParamsMap(final List<Param> ningParams) { Map<String, List<String>> params = new HashMap<>(); for (Param ningParam : ningParams) { String paramKey = ningParam.getName(); List<String> paramValues = (params.containsKey(paramKey)) ? params.get(paramKey) : new ArrayList<>(); paramValues.add(ningParam.getValue()); params.put(paramKey, paramValues); } return params; } private  ParsecHttpUtil(); }
ParsecHttpUtil { public static Map<String, List<String>> getParamsMap(final List<Param> ningParams) { Map<String, List<String>> params = new HashMap<>(); for (Param ningParam : ningParams) { String paramKey = ningParam.getName(); List<String> paramValues = (params.containsKey(paramKey)) ? params.get(paramKey) : new ArrayList<>(); paramValues.add(ningParam.getValue()); params.put(paramKey, paramValues); } return params; } 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 Map<String, List<String>> getParamsMap(final List<Param> ningParams) { Map<String, List<String>> params = new HashMap<>(); for (Param ningParam : ningParams) { String paramKey = ningParam.getName(); List<String> paramValues = (params.containsKey(paramKey)) ? params.get(paramKey) : new ArrayList<>(); paramValues.add(ningParam.getValue()); params.put(paramKey, paramValues); } return params; } 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);  }