Code example for SortedMultiset

Methods: addaddAll

0
      multiset.add(entry.getElement(), entry.getCount());
      fail("Expected IllegalArgumentException"); 
    } catch (IllegalArgumentException expected) {}
 
    try { 
      multiset.add(entry.getElement());
      fail("Expected IllegalArgumentException"); 
    } catch (IllegalArgumentException expected) {}
 
    try { 
      multiset.addAll(Collections.singletonList(entry.getElement()));
      fail("Expected IllegalArgumentException"); 
    } catch (IllegalArgumentException expected) {}
  } 
 
  void expectRemoveZero(SortedMultiset<E> multiset, Entry<E> entry) {
    assertEquals(0, multiset.remove(entry.getElement(), entry.getCount()));
    assertFalse(multiset.remove(entry.getElement()));
    assertFalse(multiset.elementSet().remove(entry.getElement()));
  } 
Experience pair programming with AI  Get Codota for Java