Code example for SortedMultiset

Methods: entrySetheadMultisettailMultiset

0
 
  @CollectionSize.Require(SEVERAL) 
  @CollectionFeature.Require(SUPPORTS_REMOVE) 
  public void testClearHeadOpen() { 
    List<Entry<E>> expected =
        copyToList(sortedMultiset.tailMultiset(b.getElement(), CLOSED).entrySet());
    sortedMultiset.headMultiset(b.getElement(), OPEN).clear();
    assertEquals(expected, copyToList(sortedMultiset.entrySet()));
  } 
 
  @CollectionSize.Require(SEVERAL) 
  @CollectionFeature.Require(SUPPORTS_REMOVE) 
  public void testClearHeadOpenEntrySet() { 
    List<Entry<E>> expected =
        copyToList(sortedMultiset.tailMultiset(b.getElement(), CLOSED).entrySet());
    sortedMultiset.headMultiset(b.getElement(), OPEN).entrySet().clear();
    assertEquals(expected, copyToList(sortedMultiset.entrySet()));
  } 
 
  @CollectionSize.Require(SEVERAL)