@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(SUPPORTS_PUT) public void testPutAll_supportedNonePresent() { putAll(createDisjointCollection()); expectAdded(e3(), e4()); }
@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({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(SUPPORTS_PUT) public void testPutAll_supportedNonePresent() { putAll(createDisjointCollection()); expectAdded(e3(), e4()); }
@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(); }