Functions { public static String mapToQuery(Map<String, ?> map) { if (map == null || map.isEmpty()) { return ""; } UriComponentsBuilder builder = UriComponentsBuilder.fromPath(""); for (Map.Entry<String, ?> e : map.entrySet()) { String name = e.getKey(); Object value = e.getValue(); builder.queryParam(name, value); } String query = builder.build().encode().toString(); return extraEncodeQuery(query.substring(1)); } private  Functions(); static String h(Object input); static String u(String value); static String br(String value); static String cut(String value, int length); static String link(String value); static String mapToQuery(Map<String, ?> map); @Deprecated static String mapToQuery(Map<String, ?> map,
            BeanWrapper beanWrapper); static String query(Object params); static String js(String value); static String hjs(String input);  }
@Test @SuppressWarnings("deprecation") public void test_Deprecated_mapToQuery() { Map<String, Object> map = new LinkedHashMap<String, Object>(); map.put("name", "Ichiro Suzuki"); map.put("age", 10); map.put("list", Arrays.asList("xxx", "yyy")); assertThat(Functions.mapToQuery(map, null), is( "name=Ichiro%20Suzuki&age=10&list=xxx,yyy")); assertThat(Functions.mapToQuery(map, new BeanWrapperImpl(new Person())), is("name=Ichiro%20Suzuki&age=10&list=xxx,yyy")); }
@Test @SuppressWarnings("deprecation") public void testDeprecatedMapToQueryIsNull() { assertThat(Functions.mapToQuery(null, null), is("")); }
@Test @SuppressWarnings("deprecation") public void testDeprecatedMapToQueryIsEmpty() { Map<String, Object> map = new LinkedHashMap<String, Object>(); assertThat(Functions.mapToQuery(map, null), is("")); }