Code example for SortedMultiset

Methods: countcomparator

0
    super.setUp(); 
    sortedMultiset = cast(getMultiset());
    entries =
        copyToList(getSubjectGenerator().getSampleElements( 
            getSubjectGenerator().getCollectionSize().getNumElements())); 
    Collections.sort(entries, sortedMultiset.comparator());
 
    // some tests assume SEVERAL == 3 
    if (entries.size() >= 1) {
      a = Multisets.immutableEntry(entries.get(0), sortedMultiset.count(entries.get(0)));
      if (entries.size() >= 3) {
        b = Multisets.immutableEntry(entries.get(1), sortedMultiset.count(entries.get(1)));
        c = Multisets.immutableEntry(entries.get(2), sortedMultiset.count(entries.get(2)));
      } 
    } 
  } 
 
  /** 
   * Resets the contents of sortedMultiset to have entries a, c, for the navigation tests. 
   */