@MapFeature.Require(SUPPORTS_PUT) public void testPutAll_nullCollectionReference() { try { getMap().putAll(null); fail("putAll(null) should throw NullPointerException"); } catch (NullPointerException expected) { } }
@MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT}) @CollectionSize.Require(absent = ZERO) public void testPutAllSomePresentConcurrentWithEntrySetIteration() { try { Iterator<Entry<K, V>> iterator = getMap().entrySet().iterator(); putAll(MinimalCollection.of(e3(), e0())); iterator.next(); fail("Expected ConcurrentModificationException"); } catch (ConcurrentModificationException expected) { // success } }
@MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_KEYS) public void testPutAll_nullKeyUnsupported() { try { putAll(containsNullKey); fail("putAll(containsNullKey) should throw"); } catch (NullPointerException expected) { } expectUnchanged(); expectNullKeyMissingWhenNullKeysUnsupported( "Should not contain null key after unsupported putAll(containsNullKey)"); }
@MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) public void testPutAll_nullValueUnsupported() { try { putAll(containsNullValue); fail("putAll(containsNullValue) should throw"); } catch (NullPointerException expected) { } expectUnchanged(); expectNullValueMissingWhenNullValuesUnsupported( "Should not contain null value after unsupported putAll(containsNullValue)"); }
@MapFeature.Require(absent = SUPPORTS_PUT) public void testPutAll_unsupportedNonePresent() { try { putAll(createDisjointCollection()); fail("putAll(nonePresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); expectMissing(e3(), e4()); }
@MapFeature.Require(absent = SUPPORTS_PUT) @CollectionSize.Require(absent = ZERO) public void testPutAll_unsupportedSomePresent() { try { putAll(MinimalCollection.of(e3(), e0())); fail("putAll(somePresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); }
@MapFeature.Require(SUPPORTS_PUT) public void testPutAll_nullCollectionReference() { try { getMap().putAll(null); fail("putAll(null) should throw NullPointerException"); } catch (NullPointerException expected) { } }
@MapFeature.Require(SUPPORTS_PUT) public void testPutAll_nullCollectionReference() { try { getMap().putAll(null); fail("putAll(null) should throw NullPointerException"); } catch (NullPointerException expected) { } }
@MapFeature.Require({ FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT }) @CollectionSize.Require(absent = ZERO) public void testPutAllSomePresentConcurrentWithEntrySetIteration() { try { Iterator<Entry<K, V>> iterator = getMap().entrySet().iterator(); putAll(MinimalCollection.of(samples.e3, samples.e0)); iterator.next(); fail("Expected ConcurrentModificationException"); } catch (ConcurrentModificationException expected) { // success } }
@MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT}) @CollectionSize.Require(absent = ZERO) public void testPutAllSomePresentConcurrentWithEntrySetIteration() { try { Iterator<Entry<K, V>> iterator = getMap().entrySet().iterator(); putAll(MinimalCollection.of(e3(), e0())); iterator.next(); fail("Expected ConcurrentModificationException"); } catch (ConcurrentModificationException expected) { // success } }
@MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_KEYS) public void testPutAll_nullKeyUnsupported() { try { putAll(containsNullKey); fail("putAll(containsNullKey) should throw"); } catch (NullPointerException expected) { } expectUnchanged(); expectNullKeyMissingWhenNullKeysUnsupported( "Should not contain null key after unsupported putAll(containsNullKey)"); }
@MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_KEYS) public void testPutAll_nullKeyUnsupported() { try { putAll(containsNullKey); fail("putAll(containsNullKey) should throw"); } catch (NullPointerException expected) { } expectUnchanged(); expectNullKeyMissingWhenNullKeysUnsupported( "Should not contain null key after unsupported " + "putAll(containsNullKey)"); }
@MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) public void testPutAll_nullValueUnsupported() { try { putAll(containsNullValue); fail("putAll(containsNullValue) should throw"); } catch (NullPointerException expected) { } expectUnchanged(); expectNullValueMissingWhenNullValuesUnsupported( "Should not contain null value after unsupported putAll(containsNullValue)"); }
@MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) public void testPutAll_nullValueUnsupported() { try { putAll(containsNullValue); fail("putAll(containsNullValue) should throw"); } catch (NullPointerException expected) { } expectUnchanged(); expectNullValueMissingWhenNullValuesUnsupported( "Should not contain null value after unsupported " + "putAll(containsNullValue)"); }
@MapFeature.Require(absent = SUPPORTS_PUT) public void testPutAll_unsupportedNonePresent() { try { putAll(createDisjointCollection()); fail("putAll(nonePresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); expectMissing(samples.e3, samples.e4); }
@MapFeature.Require(absent = SUPPORTS_PUT) @CollectionSize.Require(absent = ZERO) public void testPutAll_unsupportedSomePresent() { try { putAll(MinimalCollection.of(samples.e3, samples.e0)); fail("putAll(somePresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); }
@MapFeature.Require(absent = SUPPORTS_PUT) public void testPutAll_unsupportedNonePresent() { try { putAll(createDisjointCollection()); fail("putAll(nonePresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); expectMissing(e3(), e4()); }
@MapFeature.Require(absent = SUPPORTS_PUT) @CollectionSize.Require(absent = ZERO) public void testPutAll_unsupportedSomePresent() { try { putAll(MinimalCollection.of(e3(), e0())); fail("putAll(somePresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); }