CacheUtil { public static String getKey(Map<String, String> tags) { List<String> listOfEntries = tags.entrySet() .stream() .map(entry -> { String encodedValue = Base64.getEncoder().encodeToString(entry.getValue().getBytes()); return entry.getKey() + CACHE_KEY_DELIMITER + encodedValue; }) .sorted() .collect(Collectors.toList()); return String.join(",", listOfEntries); }  static String getKey(Map<String, String> tags); static Map<String, String> getTags(String key); static String getDetectors(List<Detector> detectors); static List<Detector> buildDetectors(String detectorsString);  }
@Test public void getKey() { initMap(); Assert.assertEquals(cacheKey, CacheUtil.getKey(tags)); }