guava/src/com/google/common/collect/Multisets.java
@Beta
  public static <E> ImmutableMultiset<E> copyHighestCountFirst(Multiset<E> multiset) {
    Entry<E>[] entries = (Entry<E>[]) multiset.entrySet().toArray(new Entry[0]);
    Arrays.sort(entries, DecreasingCount.INSTANCE);
    return ImmutableMultiset.copyFromEntries(Arrays.asList(entries));
  }
@Beta
  public static <E> ImmutableMultiset<E> copyHighestCountFirst(Multiset<E> multiset) {
    Entry<E>[] entries = (Entry<E>[]) multiset.entrySet().toArray(new Entry[0]);
    Arrays.sort(entries, DecreasingCount.INSTANCE);
    return ImmutableMultiset.copyFromEntries(Arrays.asList(entries));
  }
@ Beta public static < E > ImmutableMultiset < E > copyHighestCountFirst ( Multiset < E > multiset ) { Entry < E > [ ] entries = ( Entry < E > [ ] ) multiset . entrySet ( ) . toArray ( new Entry [ 0 ] ) ; Arrays . sort ( entries , DecreasingCount . INSTANCE ) ; return ImmutableMultiset . copyFromEntries ( Arrays . asList ( entries ) ) ; }
Returns a copy of {@code multiset} as an {@link ImmutableMultiset} whose iteration order is
highest count first, with ties broken by the iteration order of the original multiset.

@since 11.0
Returns a copy of { @code multiset } as an { @link ImmutableMultiset } whose iteration order is highest count first with ties broken by the iteration order of the original multiset .