32 |
|
|
33 |
|
|
34 |
|
/** |
35 |
< |
* |
35 |
> |
* a new list is empty |
36 |
|
*/ |
37 |
|
public void testConstructor() { |
38 |
|
CopyOnWriteArrayList a = new CopyOnWriteArrayList(); |
40 |
|
} |
41 |
|
|
42 |
|
/** |
43 |
< |
* |
43 |
> |
* new list contains all elements of initializing array |
44 |
|
*/ |
45 |
|
public void testConstructor2() { |
46 |
|
Integer[] ints = new Integer[SIZE]; |
52 |
|
} |
53 |
|
|
54 |
|
/** |
55 |
< |
* |
55 |
> |
* new list contains all elements of initializing collection |
56 |
|
*/ |
57 |
|
public void testConstructor3() { |
58 |
|
Integer[] ints = new Integer[SIZE]; |
65 |
|
|
66 |
|
|
67 |
|
/** |
68 |
< |
* addAll correctly adds each element from the given collection |
68 |
> |
* addAll adds each element from the given collection |
69 |
|
*/ |
70 |
|
public void testAddAll() { |
71 |
|
CopyOnWriteArrayList full = populatedArray(3); |
101 |
|
} |
102 |
|
|
103 |
|
/** |
104 |
< |
* addIfAbsent correctly adds the element when it does not exist in the list |
104 |
> |
* addIfAbsent adds the element when it does not exist in the list |
105 |
|
*/ |
106 |
|
public void testAddIfAbsent2() { |
107 |
|
CopyOnWriteArrayList full = populatedArray(SIZE); |
110 |
|
} |
111 |
|
|
112 |
|
/** |
113 |
< |
* clear correctly removes all elements from the list |
113 |
> |
* clear removes all elements from the list |
114 |
|
*/ |
115 |
|
public void testClear() { |
116 |
|
CopyOnWriteArrayList full = populatedArray(SIZE); |
131 |
|
} |
132 |
|
|
133 |
|
/** |
134 |
< |
* contains returns the correct values |
134 |
> |
* contains is true for added elements |
135 |
|
*/ |
136 |
|
public void testContains() { |
137 |
|
CopyOnWriteArrayList full = populatedArray(3); |
140 |
|
} |
141 |
|
|
142 |
|
/** |
143 |
< |
* |
143 |
> |
* adding at an index places it in the indindicated index |
144 |
|
*/ |
145 |
|
public void testAddIndex() { |
146 |
|
CopyOnWriteArrayList full = populatedArray(3); |
156 |
|
} |
157 |
|
|
158 |
|
/** |
159 |
< |
* |
159 |
> |
* lists with same elements are equal and have same hashCode |
160 |
|
*/ |
161 |
|
public void testEquals() { |
162 |
|
CopyOnWriteArrayList a = populatedArray(3); |
175 |
|
|
176 |
|
|
177 |
|
/** |
178 |
< |
* containsAll returns the correct values |
178 |
> |
* containsAll returns true for collection with subset of elements |
179 |
|
*/ |
180 |
|
public void testContainsAll() { |
181 |
|
CopyOnWriteArrayList full = populatedArray(3); |
188 |
|
} |
189 |
|
|
190 |
|
/** |
191 |
< |
* get returns the correct value for the given index |
191 |
> |
* get returns the value at the given index |
192 |
|
*/ |
193 |
|
public void testGet() { |
194 |
|
CopyOnWriteArrayList full = populatedArray(3); |
196 |
|
} |
197 |
|
|
198 |
|
/** |
199 |
< |
* indexOf gives the correct index for the given object |
199 |
> |
* indexOf gives the index for the given object |
200 |
|
*/ |
201 |
|
public void testIndexOf() { |
202 |
|
CopyOnWriteArrayList full = populatedArray(3); |
205 |
|
} |
206 |
|
|
207 |
|
/** |
208 |
< |
* indexOf gives the correct index based on the given index |
208 |
> |
* indexOf gives the index based on the given index |
209 |
|
* at which to start searching |
210 |
|
*/ |
211 |
|
public void testIndexOf2() { |
215 |
|
} |
216 |
|
|
217 |
|
/** |
218 |
< |
* isEmpty returns the correct values |
218 |
> |
* isEmpty returns true when empty, else false |
219 |
|
*/ |
220 |
|
public void testIsEmpty() { |
221 |
|
CopyOnWriteArrayList empty = new CopyOnWriteArrayList(); |
237 |
|
} |
238 |
|
|
239 |
|
/** |
240 |
< |
* |
240 |
> |
* iterator.remove throws UnsupportedOperationException |
241 |
|
*/ |
242 |
|
public void testIteratorRemove () { |
243 |
|
CopyOnWriteArrayList full = populatedArray(SIZE); |
251 |
|
} |
252 |
|
|
253 |
|
/** |
254 |
< |
* |
254 |
> |
* toString contains toString of elements |
255 |
|
*/ |
256 |
|
public void testToString() { |
257 |
|
CopyOnWriteArrayList full = populatedArray(3); |
262 |
|
} |
263 |
|
|
264 |
|
/** |
265 |
< |
* lastIndexOf returns the correct index for the given object |
265 |
> |
* lastIndexOf returns the index for the given object |
266 |
|
*/ |
267 |
|
public void testLastIndexOf1() { |
268 |
|
CopyOnWriteArrayList full = populatedArray(3); |
273 |
|
} |
274 |
|
|
275 |
|
/** |
276 |
< |
* lastIndexOf returns the correct index from the given starting point |
276 |
> |
* lastIndexOf returns the index from the given starting point |
277 |
|
*/ |
278 |
|
public void testlastIndexOf2() { |
279 |
|
CopyOnWriteArrayList full = populatedArray(3); |
284 |
|
} |
285 |
|
|
286 |
|
/** |
287 |
< |
* Identical to testIterator, except ListInterator has more functionality |
287 |
> |
* listIterator traverses all elements |
288 |
|
*/ |
289 |
|
public void testListIterator1() { |
290 |
|
CopyOnWriteArrayList full = populatedArray(SIZE); |
308 |
|
} |
309 |
|
|
310 |
|
/** |
311 |
< |
* remove correctly removes and returns the object at the given index |
311 |
> |
* remove removes and returns the object at the given index |
312 |
|
*/ |
313 |
|
public void testRemove() { |
314 |
|
CopyOnWriteArrayList full = populatedArray(3); |
317 |
|
} |
318 |
|
|
319 |
|
/** |
320 |
< |
* removeAll correctly removes all elements from the given collection |
320 |
> |
* removeAll removes all elements from the given collection |
321 |
|
*/ |
322 |
|
public void testRemoveAll() { |
323 |
|
CopyOnWriteArrayList full = populatedArray(3); |
329 |
|
} |
330 |
|
|
331 |
|
/** |
332 |
< |
* set correctly changes the element at the given index |
332 |
> |
* set changes the element at the given index |
333 |
|
*/ |
334 |
|
public void testSet() { |
335 |
|
CopyOnWriteArrayList full = populatedArray(3); |
338 |
|
} |
339 |
|
|
340 |
|
/** |
341 |
< |
* size returns the correct values |
341 |
> |
* size returns the number of elements |
342 |
|
*/ |
343 |
|
public void testSize() { |
344 |
|
CopyOnWriteArrayList empty = new CopyOnWriteArrayList(); |
375 |
|
|
376 |
|
|
377 |
|
/** |
378 |
< |
* |
378 |
> |
* sublists contains elements at indexes offset from their base |
379 |
|
*/ |
380 |
|
public void testSubList() { |
381 |
|
CopyOnWriteArrayList a = populatedArray(10); |
595 |
|
} |
596 |
|
|
597 |
|
/** |
598 |
< |
* |
598 |
> |
* a deserialized serialiszed list is equal |
599 |
|
*/ |
600 |
|
public void testSerialization() { |
601 |
|
CopyOnWriteArrayList q = populatedArray(SIZE); |