private void checkRemove() throws Exception { ArrayList4<Integer> list = retrieveAndAssertNullArrayList4(); Assert.areEqual(ArrayList4Asserter.CAPACITY - 1, list.size()); for (int i = 0; i < ArrayList4Asserter.CAPACITY - 1; ++i) { Assert.areEqual(new Integer(i + 1), list.get(i)); } }
private void checkListSizeAndContents(int expectedSize) throws Exception { ArrayList4<Integer> list = retrieveAndAssertNullArrayList4(); Assert.areEqual(expectedSize, list.size()); for (int i = 0; i < expectedSize; ++i) { Assert.areEqual(new Integer(i), list.get(i)); } }
public void operate(ArrayList4<Integer> list) { final Vector<Integer> v = new Vector<Integer>(); for (int i = 0; i < ArrayList4Asserter.CAPACITY; ++i) { v.add(new Integer(ArrayList4Asserter.CAPACITY + i)); } list.addAll(v); }
public void operate(ArrayList4<Integer> list) { list.subList(ArrayList4Asserter.CAPACITY - 10, ArrayList4Asserter.CAPACITY).clear(); }
public void operate(ArrayList4<Integer> list) { Assert.isFalse(list.contains(new Integer(ArrayList4Asserter.CAPACITY))); }
public void operate(ArrayList4<Integer> list) { list.clear(); }
public void operate(ArrayList4<Integer> list) { list.set(0, new Integer(1)); }
private void checkClear() throws Exception { ArrayList4<Integer> list = retrieveAndAssertNullArrayList4(); Assert.areEqual(0, list.size()); }
private void checkAddAll() throws Exception { ArrayList4<Integer> list = retrieveAndAssertNullArrayList4(); for (int i = 0; i < ArrayList4Asserter.CAPACITY * 2; ++i) { Assert.areEqual(new Integer(i), list.get(i)); } }
public void operate(ArrayList4<Integer> list) { list.remove(0); }
public void operate(ArrayList4<Integer> list) { list.add(new Integer(ArrayList4Asserter.CAPACITY)); }