@CollectionFeature.Require(value = SUPPORTS_ADD, absent = ALLOWS_NULL_VALUES) public void testAdd_nullUnsupported() { try { collection.add(null); fail("add(null) should throw"); } catch (NullPointerException expected) { } expectUnchanged(); expectNullMissingWhenNullUnsupported("Should not contain null after unsupported add(null)"); }
@CollectionFeature.Require(absent = SUPPORTS_ADD) @CollectionSize.Require(absent = ZERO) public void testAdd_unsupportedPresent() { try { assertFalse("add(present) should return false or throw", collection.add(e0())); } catch (UnsupportedOperationException tolerated) { } expectUnchanged(); }
@CollectionFeature.Require(absent = SUPPORTS_ADD) public void testAdd_unsupportedNotPresent() { try { collection.add(e3()); fail("add(notPresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); expectMissing(e3()); }
@CollectionFeature.Require(absent = SUPPORTS_ADD) @CollectionSize.Require(absent = ZERO) public void testAdd_unsupportedPresent() { try { assertFalse("add(present) should return false or throw", collection.add(samples.e0)); } catch (UnsupportedOperationException tolerated) { } expectUnchanged(); }
@CollectionFeature.Require(value = SUPPORTS_ADD, absent = ALLOWS_NULL_VALUES) public void testAdd_nullUnsupported() { try { collection.add(null); fail("add(null) should throw"); } catch (NullPointerException expected) { } expectUnchanged(); expectNullMissingWhenNullUnsupported("Should not contain null after unsupported add(null)"); }
@CollectionFeature.Require(absent = SUPPORTS_ADD) public void testAdd_unsupportedNotPresent() { try { collection.add(samples.e3); fail("add(notPresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); expectMissing(samples.e3); }
@CollectionFeature.Require(value = SUPPORTS_ADD, absent = ALLOWS_NULL_VALUES) public void testAdd_nullUnsupported() { try { collection.add(null); fail("add(null) should throw"); } catch (NullPointerException expected) { } expectUnchanged(); expectNullMissingWhenNullUnsupported( "Should not contain null after unsupported add(null)"); }
@CollectionFeature.Require(absent = SUPPORTS_ADD) @CollectionSize.Require(absent = ZERO) public void testAdd_unsupportedPresent() { try { assertFalse("add(present) should return false or throw", collection.add(e0())); } catch (UnsupportedOperationException tolerated) { } expectUnchanged(); }
@CollectionFeature.Require(absent = SUPPORTS_ADD) public void testAdd_unsupportedNotPresent() { try { collection.add(e3()); fail("add(notPresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); expectMissing(e3()); }