@Override protected void verify(List<E> elements) { expectContents(elements); } }.test();
public void testListIterator_tooHigh() { try { getList().listIterator(getNumElements() + 1); fail(); } catch (IndexOutOfBoundsException expected) { } }
protected Collection<Method> suppressForCopyOnWriteArrayList() { return asList( getSubListOriginalListSetAffectsSubListMethod(), getSubListOriginalListSetAffectsSubListLargeListMethod(), getSubListSubListRemoveAffectsOriginalLargeListMethod(), getListIteratorFullyModifiableMethod(), getSpliteratorNotImmutableCollectionAllowsAddMethod(), getSpliteratorNotImmutableCollectionAllowsRemoveMethod()); }
public void testListIterator_atSize() { getList().listIterator(getNumElements()); // TODO: run the iterator through ListIteratorTester }
@CollectionFeature.Require(absent = SUPPORTS_REMOVE) @ListFeature.Require(absent = {SUPPORTS_SET, SUPPORTS_ADD_WITH_INDEX}) public void testListIterator_unmodifiable() { runListIteratorTest(UNMODIFIABLE); }
private void runListIteratorTest(Set<IteratorFeature> features) { new ListIteratorTester<E>( listListIteratorTesterNumIterations(), singleton(e4()), features, Helpers.copyToList(getOrderedElements()), 0) { @Override protected ListIterator<E> newTargetIterator() { resetCollection(); return getList().listIterator(); } @Override protected void verify(List<E> elements) { expectContents(elements); } }.test(); }
@Override protected ListIterator<E> newTargetIterator() { resetCollection(); return getList().listIterator(); }
private void runListIteratorTest(Set<IteratorFeature> features) { new ListIteratorTester<E>( listListIteratorTesterNumIterations(), singleton(samples.e4), features, Helpers.copyToList(getOrderedElements()), 0) { { // TODO: don't set this universally stopTestingWhenAddThrowsException(); } @Override protected ListIterator<E> newTargetIterator() { resetCollection(); return getList().listIterator(); } @Override protected void verify(List<E> elements) { expectContents(elements); } }.test(); }
public void testListIterator_atSize() { getList().listIterator(getNumElements()); // TODO: run the iterator through ListIteratorTester }
@CollectionFeature.Require(SUPPORTS_REMOVE) @ListFeature.Require({SUPPORTS_SET, SUPPORTS_ADD_WITH_INDEX}) public void testListIterator_fullyModifiable() { runListIteratorTest(MODIFIABLE); }
private void runListIteratorTest(Set<IteratorFeature> features) { new ListIteratorTester<E>( listListIteratorTesterNumIterations(), singleton(e4()), features, Helpers.copyToList(getOrderedElements()), 0) { @Override protected ListIterator<E> newTargetIterator() { resetCollection(); return getList().listIterator(); } @Override protected void verify(List<E> elements) { expectContents(elements); } }.test(); }
@Override protected ListIterator<E> newTargetIterator() { resetCollection(); return getList().listIterator(); }
public void testListIterator_tooHigh() { try { getList().listIterator(getNumElements() + 1); fail(); } catch (IndexOutOfBoundsException expected) { } }
public void testListIterator_atSize() { getList().listIterator(getNumElements()); // TODO: run the iterator through ListIteratorTester }
@CollectionFeature.Require(absent = SUPPORTS_REMOVE) @ListFeature.Require(absent = {SUPPORTS_SET, SUPPORTS_ADD_WITH_INDEX}) public void testListIterator_unmodifiable() { runListIteratorTest(UNMODIFIABLE); }
@Override protected void verify(List<E> elements) { expectContents(elements); } }.test();
@Override protected ListIterator<E> newTargetIterator() { resetCollection(); return getList().listIterator(); }