Is there an effective way to convert java map values to comma separated string using guava or StringUtils?
Map<String, String> testMap = new HashMap<>();
testMap.put("key1", "val1");
testMap.put("key2", "val2");
looking for a way to convert testMap to a String -> "val1,val2".
Here's how to do it in Java 8+ (doesn't require Guava, StringUtils, or other external libraries):
testMap.values().stream().map(Object::toString).collect(Collectors.joining(","));