docs: public static <K, V> Map<K, V> toSorted(Map<K, V> self, Comparator<Map.Entry<K, V>> comparator) {
          List<Map.Entry<K, V>> sortedEntries = toSorted(self.entrySet(), comparator);
          Map<K, V> result = new LinkedHashMap<K, V>();
          for (Map.Entry<K, V> entry : sortedEntries) {
              result.put(entry.getKey(), entry.getValue());
          }
          return result;
      }