code: private static <K, V> void makeSetsImmutable(Map<K, Set<V>> map) {
      Set<K> keys = map.keySet();
      for (K key : keys) {
        Set<V> value = map.get(key);
        map.put(key, Collections.unmodifiableSet(value));
      }
    }
docs: Convert values to immutable sets.