Guava方式
Map<String, String> attributes = new HashMap<>();
attributes.put("a", "1");
attributes.put("b", "2");
attributes.put("c", "3");
// Guava way
String result = Joiner.on("&").withKeyValueSeparator("=").join(attributes);
result为:a=1&b=2&c=3.
Java8方式
String s = attributes.entrySet()
.stream()
.map(Object::toString)
.collect(joining("&"));