### Question:
TriggerInternalIdCalculator { @SuppressWarnings("UnstableApiUsage") public static String getId(String name, List<String> activeProfiles, Map<String, Object> arguments, Map<String, Object> conditions, Map<String, Object> cfg) { HashFunction hf = Hashing.sha256(); return hf.newHasher() .putString(name, StandardCharsets.UTF_8) .putObject(ensureList(activeProfiles), (from, into) -> from.stream().sorted().forEach(p -> into.putString(p, StandardCharsets.UTF_8))) .putBytes(serialize(toSortedMap(arguments))) .putBytes(serialize(toSortedMap(conditions))) .putBytes(serialize(toSortedMap(cfg))) .hash() .toString(); } private  TriggerInternalIdCalculator(); @SuppressWarnings("UnstableApiUsage") static String getId(String name, List<String> activeProfiles, Map<String, Object> arguments, Map<String, Object> conditions, Map<String, Object> cfg);  }### Answer:
@Test public void testEmpty() { String name = "trigger"; List<String> activeProfiles = new ArrayList<>(); Map<String, Object> arguments = new HashMap<>(); Map<String, Object> conditions = new HashMap<>(); Map<String, Object> cfg = new HashMap<>(); String id1 = TriggerInternalIdCalculator.getId(name, activeProfiles, arguments, conditions, cfg); String id2 = TriggerInternalIdCalculator.getId(name, activeProfiles, arguments, conditions, cfg); assertEquals(id1, id2); }
@Test public void test1() { String name = "trigger"; List<String> activeProfiles = new ArrayList<>(); Map<String, Object> arguments = new HashMap<>(); Map<String, Object> conditions = new HashMap<>(); Map<String, Object> cfg1 = new HashMap<>(); cfg1.put("a", "a-value"); cfg1.put("b", Collections.singletonMap("k", "v")); cfg1.put("c", "c-value"); Map<String, Object> cfg2 = new HashMap<>(); cfg2.put("c", "c-value"); cfg2.put("a", "a-value"); cfg2.put("b", Collections.singletonMap("k", "v")); String id1 = TriggerInternalIdCalculator.getId(name, activeProfiles, arguments, conditions, cfg1); String id2 = TriggerInternalIdCalculator.getId(name, activeProfiles, arguments, conditions, cfg2); assertEquals(id1, id2); }