private void assertSetCountIncreasingFailure(E element, int count) { try { setCountNoCheckReturnValue(element, count); fail("a call to multiset.setCount() to increase an element's count should throw"); } catch (UnsupportedOperationException expected) { } }
private void assertSetCountDecreasingFailure(E element, int count) { try { setCountNoCheckReturnValue(element, count); fail("a call to multiset.setCount() to decrease an element's count should throw"); } catch (UnsupportedOperationException expected) { } }
@CollectionFeature.Require(value = SUPPORTS_ADD, absent = ALLOWS_NULL_VALUES) public void testSetCount_addNull_nullUnsupported() { try { setCountNoCheckReturnValue(null, 1); fail("adding null with setCount() should throw NullPointerException"); } catch (NullPointerException expected) { } }
@CollectionFeature.Require(SUPPORTS_REMOVE) public void testSetCount_negative_removeSupported() { try { setCountNoCheckReturnValue(e3(), -1); fail("calling setCount() with a negative count should throw IllegalArgumentException"); } catch (IllegalArgumentException expected) { } }
@CollectionFeature.Require(absent = SUPPORTS_REMOVE) public void testSetCount_negative_removeUnsupported() { try { setCountNoCheckReturnValue(e3(), -1); fail( "calling setCount() with a negative count should throw " + "IllegalArgumentException or UnsupportedOperationException"); } catch (IllegalArgumentException | UnsupportedOperationException expected) { } }
private void assertSetCountIncreasingFailure(E element, int count) { try { setCountNoCheckReturnValue(element, count); fail("a call to multiset.setCount() to increase an element's count should throw"); } catch (UnsupportedOperationException expected) { } }
private void assertSetCountDecreasingFailure(E element, int count) { try { setCountNoCheckReturnValue(element, count); fail("a call to multiset.setCount() to decrease an element's count should throw"); } catch (UnsupportedOperationException expected) { } }
private void assertSetCountIncreasingFailure(E element, int count) { try { setCountNoCheckReturnValue(element, count); fail("a call to multiset.setCount() to increase an element's count " + "should throw"); } catch (UnsupportedOperationException expected) { } }
private void assertSetCountDecreasingFailure(E element, int count) { try { setCountNoCheckReturnValue(element, count); fail("a call to multiset.setCount() to decrease an element's count " + "should throw"); } catch (UnsupportedOperationException expected) { } }
@CollectionFeature.Require(value = SUPPORTS_ADD, absent = ALLOWS_NULL_VALUES) public void testSetCount_addNull_nullUnsupported() { try { setCountNoCheckReturnValue(null, 1); fail("adding null with setCount() should throw NullPointerException"); } catch (NullPointerException expected) { } }
@CollectionFeature.Require(value = SUPPORTS_ADD, absent = ALLOWS_NULL_VALUES) public void testSetCount_addNull_nullUnsupported() { try { setCountNoCheckReturnValue(null, 1); fail("adding null with setCount() should throw NullPointerException"); } catch (NullPointerException expected) { } }
@CollectionFeature.Require(SUPPORTS_REMOVE) public void testSetCount_negative_removeSupported() { try { setCountNoCheckReturnValue(samples.e3, -1); fail("calling setCount() with a negative count should throw " + "IllegalArgumentException"); } catch (IllegalArgumentException expected) { } }
@CollectionFeature.Require(absent = SUPPORTS_REMOVE) public void testSetCount_negative_removeUnsupported() { try { setCountNoCheckReturnValue(samples.e3, -1); fail("calling setCount() with a negative count should throw " + "IllegalArgumentException or UnsupportedOperationException"); } catch (IllegalArgumentException expected) { } catch (UnsupportedOperationException expected) { } }
@CollectionFeature.Require(absent = SUPPORTS_REMOVE) public void testSetCount_negative_removeUnsupported() { try { setCountNoCheckReturnValue(e3(), -1); fail( "calling setCount() with a negative count should throw " + "IllegalArgumentException or UnsupportedOperationException"); } catch (IllegalArgumentException | UnsupportedOperationException expected) { } }
@CollectionFeature.Require(SUPPORTS_REMOVE) public void testSetCount_negative_removeSupported() { try { setCountNoCheckReturnValue(e3(), -1); fail("calling setCount() with a negative count should throw IllegalArgumentException"); } catch (IllegalArgumentException expected) { } }