public static <K, V> ImmutableSortedMap<K, V> copyOf(
      Map<? extends K, ? extends V> map, Comparator<? super K> comparator) {
    return copyOfInternal(map, checkNotNull(comparator));
  }
public static <K, V> ImmutableSortedMap<K, V> copyOf(
      Map<? extends K, ? extends V> map, Comparator<? super K> comparator) {
    return copyOfInternal(map, checkNotNull(comparator));
  }
public static < K , V > ImmutableSortedMap < K , V > copyOf ( Map < ? extends K , ? extends V > map , Comparator < ? super K > comparator ) { return copyOfInternal ( map , checkNotNull ( comparator ) ) ; }
Returns an immutable map containing the same entries as {@code map}, with keys sorted by the
provided comparator.

<p>Despite the method name, this method attempts to avoid actually copying the data when it is
safe to do so. The exact circumstances under which a copy will or will not be performed are
undocumented and subject to change.

@throws NullPointerException if any key or value in {@code map} is null
@throws IllegalArgumentException if any two keys are equal according to the comparator
Returns an immutable map containing the same entries as { @code map } with keys sorted by the provided comparator .