@ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX) public void testAddAtIndex_unsupportedNotPresent() { try { getList().add(0, e3()); fail("add(n, notPresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); expectMissing(e3()); }
@ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) public void testAddAtIndex_negative() { try { getList().add(-1, e3()); fail("add(-1, e) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); expectMissing(e3()); }
@ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) public void testAddAtIndex_tooLarge() { try { getList().add(getNumElements() + 1, e3()); fail("add(size + 1, e) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); expectMissing(e3()); }
@ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) public void testAddAtIndex_negative() { try { getList().add(-1, samples.e3); fail("add(-1, e) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); expectMissing(samples.e3); }
@ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX) public void testAddAtIndex_unsupportedNotPresent() { try { getList().add(0, samples.e3); fail("add(n, notPresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); expectMissing(samples.e3); }
@ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) public void testAddAtIndex_tooLarge() { try { getList().add(getNumElements() + 1, samples.e3); fail("add(size + 1, e) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); expectMissing(samples.e3); }
@ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX) public void testAddAtIndex_unsupportedNotPresent() { try { getList().add(0, e3()); fail("add(n, notPresent) should throw"); } catch (UnsupportedOperationException expected) { } expectUnchanged(); expectMissing(e3()); }
@ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) public void testAddAtIndex_negative() { try { getList().add(-1, e3()); fail("add(-1, e) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); expectMissing(e3()); }
@ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) public void testAddAtIndex_tooLarge() { try { getList().add(getNumElements() + 1, e3()); fail("add(size + 1, e) should throw"); } catch (IndexOutOfBoundsException expected) { } expectUnchanged(); expectMissing(e3()); }