android/guava/src/com/google/common/collect/ImmutableSortedMultiset.java
public static <E> ImmutableSortedMultiset<E> copyOf(Iterable<? extends E> elements) {
    // Hack around E not being a subtype of Comparable.
    // Unsafe, see ImmutableSortedMultisetFauxverideShim.
    @SuppressWarnings("unchecked")
    Ordering<E> naturalOrder = (Ordering<E>) Ordering.<Comparable>natural();
    return copyOf(naturalOrder, elements);
  }
public static <E> ImmutableSortedMultiset<E> copyOf(Iterable<? extends E> elements) {
    // Hack around E not being a subtype of Comparable.
    // Unsafe, see ImmutableSortedMultisetFauxverideShim.
    @SuppressWarnings("unchecked")
    Ordering<E> naturalOrder = (Ordering<E>) Ordering.<Comparable>natural();
    return copyOf(naturalOrder, elements);
  }
public static < E > ImmutableSortedMultiset < E > copyOf ( Iterable < ? extends E > elements ) { // Hack around E not being a subtype of Comparable. // Unsafe, see ImmutableSortedMultisetFauxverideShim. @ SuppressWarnings ( "unchecked" ) Ordering < E > naturalOrder = ( Ordering < E > ) Ordering . < Comparable > natural ( ) ; return copyOf ( naturalOrder , elements ) ; }
Returns an immutable sorted multiset containing the given elements sorted by their natural
ordering. To create a copy of a {@code SortedMultiset} that preserves the comparator, call
{@link #copyOfSorted} instead. This method iterates over {@code elements} at most once.

<p>Note that if {@code s} is a {@code Multiset<String>}, then {@code
ImmutableSortedMultiset.copyOf(s)} returns an {@code ImmutableSortedMultiset<String>}
containing each of the strings in {@code s}, while {@code ImmutableSortedMultiset.of(s)}
returns an {@code ImmutableSortedMultiset<Multiset<String>>} containing one element (the given
multiset itself).

<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.

<p>This method is not type-safe, as it may be called on elements that are not mutually
comparable.

@throws ClassCastException if the elements are not mutually comparable
@throws NullPointerException if any of {@code elements} is null
Returns an immutable sorted multiset containing the given elements sorted by their natural ordering . To create a copy of a { @code SortedMultiset } that preserves the comparator call { @link #copyOfSorted } instead . This method iterates over { @code elements } at most once .