@ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) public void testRemoveAtIndex_negative() { try { getList().remove(-1); fail("remove(-1) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); }
@CollectionFeature.Require(FAILS_FAST_ON_CONCURRENT_MODIFICATION) @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) @CollectionSize.Require(absent = ZERO) public void testRemoveAtIndexConcurrentWithIteration() { try { Iterator<E> iterator = collection.iterator(); getList().remove(getNumElements() / 2); iterator.next(); fail("Expected ConcurrentModificationException"); } catch (ConcurrentModificationException expected) { // success } }
@ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) public void testRemoveAtIndex_tooLarge() { try { getList().remove(getNumElements()); fail("remove(size) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); }
@ListFeature.Require(absent = SUPPORTS_REMOVE_WITH_INDEX) @CollectionSize.Require(absent = ZERO) public void testRemoveAtIndex_unsupported() { try { getList().remove(0); fail("remove(i) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); }
@ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) public void testRemoveAtIndex_negative() { try { getList().remove(-1); fail("remove(-1) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); }
@ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) public void testRemoveAtIndex_negative() { try { getList().remove(-1); fail("remove(-1) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); }
@ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) public void testRemoveAtIndex_tooLarge() { try { getList().remove(getNumElements()); fail("remove(size) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); }
@CollectionFeature.Require(FAILS_FAST_ON_CONCURRENT_MODIFICATION) @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) @CollectionSize.Require(absent = ZERO) public void testRemoveAtIndexConcurrentWithIteration() { try { Iterator<E> iterator = collection.iterator(); getList().remove(getNumElements() / 2); iterator.next(); fail("Expected ConcurrentModificationException"); } catch (ConcurrentModificationException expected) { // success } }
@CollectionFeature.Require(FAILS_FAST_ON_CONCURRENT_MODIFICATION) @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) @CollectionSize.Require(absent = ZERO) public void testRemoveAtIndexConcurrentWithIteration() { try { Iterator<E> iterator = collection.iterator(); getList().remove(getNumElements() / 2); iterator.next(); fail("Expected ConcurrentModificationException"); } catch (ConcurrentModificationException expected) { // success } }
@ListFeature.Require(absent = SUPPORTS_REMOVE_WITH_INDEX) @CollectionSize.Require(absent = ZERO) public void testRemoveAtIndex_unsupported() { try { getList().remove(0); fail("remove(i) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); }
@ListFeature.Require(absent = SUPPORTS_REMOVE_WITH_INDEX) @CollectionSize.Require(absent = ZERO) public void testRemoveAtIndex_unsupported() { try { getList().remove(0); fail("remove(i) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); }
@ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) public void testRemoveAtIndex_tooLarge() { try { getList().remove(getNumElements()); fail("remove(size) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); }