### Question:
Util { public static String concatenate(Map<String, Object> map, String[] keys, String delimiter) { List<String> values = new ArrayList<>(); for (String key : keys) { values.add(map.get(key).toString()); } return values.stream().collect(Collectors.joining(delimiter)); } private  Util(); static boolean contains(Map<String, ?> x, Map<String, ?> y, String[] keys); static String concatenate(Map<String, Object> map, String[] keys, String delimiter); static Map<String, Object> parseJson(String json); static String getUniqueID(String idstring); static String getStackTrace(Exception e); static String base64Decode(String encodedStr); static String encodeUrl(String toBeEncoded); static String base64Encode(String str); static Map<String,Object> getHeader(String base64Creds); static List<Map<String, T>> fetchDataFromS3(String s3Account,String s3Region,String s3Role, String bucketName,String path); static List<String> retrieveErrorRecords(String responseStr);  }### Answer:
@Test public void testConcatenate() { HashMap<String, Object> hash = new HashMap<>(); hash.put("foo", "3"); hash.put("bar", "4"); hash.put("baz", "5"); Assert.assertEquals("3", Util.concatenate(hash, new String[]{"foo"}, ",")); Assert.assertEquals("4,5", Util.concatenate(hash, new String[]{"bar", "baz"}, ",")); }