### Question:
URLUtils { public static String toQueryString(Map<String, String> params) { return params.entrySet().stream() .map(p -> p.getKey() + "=" + p.getValue()) .reduce((p1, p2) -> p1 + "&" + p2) .map(s -> "?" + s) .orElse(""); }  static Map<String, String> splitQuery(URL url); static String toQueryString(Map<String, String> params);  }### Answer:
@Test public void canConstructQueryString() { Map<String, String> map = ImmutableMap.of("k1", "v1", "k2", "v2"); String expected = "?k1=v1&k2=v2"; String actual = URLUtils.toQueryString(map); assertEquals(expected, actual); }