private boolean setCount(E element, int count) { return getMultiset().setCount(element, getMultiset().count(element), count); }
private void assertSetCountNegativeOldCount() { try { getMultiset().setCount(e3(), -1, 1); fail("calling setCount() with a negative oldCount should throw IllegalArgumentException"); } catch (IllegalArgumentException expected) { } }
@CollectionFeature.Require(SUPPORTS_ADD) public void testSetCountConditional_oldCountTooLarge() { assertFalse( "setCount() with a too-large oldCount should return false", getMultiset().setCount(e0(), 2, 3)); expectUnchanged(); }
@CollectionSize.Require(SEVERAL) @CollectionFeature.Require(SUPPORTS_ADD) public void testSetCountConditional_oldCountTooSmallNonzero() { initThreeCopies(); assertFalse( "setCount() with a too-small oldCount should return false", getMultiset().setCount(e0(), 1, 5)); expectContents(nCopies(3, e0())); }
@CollectionSize.Require(absent = ZERO) @CollectionFeature.Require(SUPPORTS_ADD) public void testSetCountConditional_oldCountTooSmallZero() { assertFalse( "setCount() with a too-small oldCount should return false", getMultiset().setCount(e0(), 0, 2)); expectUnchanged(); }
private boolean setCount(E element, int count) { return getMultiset().setCount(element, getMultiset().count(element), count); }
private boolean setCount(E element, int count) { return getMultiset().setCount(element, getMultiset().count(element), count); }
private void assertSetCountNegativeOldCount() { try { getMultiset().setCount(samples.e3, -1, 1); fail("calling setCount() with a negative oldCount should throw " + "IllegalArgumentException"); } catch (IllegalArgumentException expected) { } }
private void assertSetCountNegativeOldCount() { try { getMultiset().setCount(e3(), -1, 1); fail("calling setCount() with a negative oldCount should throw IllegalArgumentException"); } catch (IllegalArgumentException expected) { } }
@CollectionFeature.Require(SUPPORTS_ADD) public void testSetCountConditional_oldCountTooLarge() { assertFalse("setCount() with a too-large oldCount should return false", getMultiset().setCount(samples.e0, 2, 3)); expectUnchanged(); }
@CollectionSize.Require(SEVERAL) @CollectionFeature.Require(SUPPORTS_ADD) public void testSetCountConditional_oldCountTooSmallNonzero() { initThreeCopies(); assertFalse("setCount() with a too-small oldCount should return false", getMultiset().setCount(samples.e0, 1, 5)); expectContents(nCopies(3, samples.e0)); }
@CollectionSize.Require(absent = ZERO) @CollectionFeature.Require(SUPPORTS_ADD) public void testSetCountConditional_oldCountTooSmallZero() { assertFalse("setCount() with a too-small oldCount should return false", getMultiset().setCount(samples.e0, 0, 2)); expectUnchanged(); }
@CollectionFeature.Require(SUPPORTS_ADD) public void testSetCountConditional_oldCountTooLarge() { assertFalse( "setCount() with a too-large oldCount should return false", getMultiset().setCount(e0(), 2, 3)); expectUnchanged(); }
@CollectionSize.Require(SEVERAL) @CollectionFeature.Require(SUPPORTS_ADD) public void testSetCountConditional_oldCountTooSmallNonzero() { initThreeCopies(); assertFalse( "setCount() with a too-small oldCount should return false", getMultiset().setCount(e0(), 1, 5)); expectContents(nCopies(3, e0())); }
@CollectionSize.Require(absent = ZERO) @CollectionFeature.Require(SUPPORTS_ADD) public void testSetCountConditional_oldCountTooSmallZero() { assertFalse( "setCount() with a too-small oldCount should return false", getMultiset().setCount(e0(), 0, 2)); expectUnchanged(); }