Code example for SortedMultiset

Methods: entrySetheadMultisettailMultiset

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