176 |
|
List full = populatedArray(SIZE); |
177 |
|
Iterator i = full.iterator(); |
178 |
|
int j; |
179 |
< |
for(j = 0; i.hasNext(); j++) |
179 |
> |
for (j = 0; i.hasNext(); j++) |
180 |
|
assertEquals(j, ((Integer)i.next()).intValue()); |
181 |
|
assertEquals(SIZE, j); |
182 |
|
} |
222 |
|
List full = populatedArray(SIZE); |
223 |
|
ListIterator i = full.listIterator(); |
224 |
|
int j; |
225 |
< |
for(j = 0; i.hasNext(); j++) |
225 |
> |
for (j = 0; i.hasNext(); j++) |
226 |
|
assertEquals(j, ((Integer)i.next()).intValue()); |
227 |
|
assertEquals(SIZE, j); |
228 |
|
} |
234 |
|
List full = populatedArray(3); |
235 |
|
ListIterator i = full.listIterator(1); |
236 |
|
int j; |
237 |
< |
for(j = 0; i.hasNext(); j++) |
237 |
> |
for (j = 0; i.hasNext(); j++) |
238 |
|
assertEquals(j+1, ((Integer)i.next()).intValue()); |
239 |
|
assertEquals(2, j); |
240 |
|
} |
312 |
|
public void testSubList() { |
313 |
|
List a = populatedArray(10); |
314 |
|
assertTrue(a.subList(1,1).isEmpty()); |
315 |
< |
for(int j = 0; j < 9; ++j) { |
316 |
< |
for(int i = j ; i < 10; ++i) { |
315 |
> |
for (int j = 0; j < 9; ++j) { |
316 |
> |
for (int i = j ; i < 10; ++i) { |
317 |
|
List b = a.subList(j,i); |
318 |
< |
for(int k = j; k < i; ++k) { |
318 |
> |
for (int k = j; k < i; ++k) { |
319 |
|
assertEquals(new Integer(k), b.get(k-j)); |
320 |
|
} |
321 |
|
} |
342 |
|
c.add("asdadasd"); |
343 |
|
c.toArray(new Long[5]); |
344 |
|
shouldThrow(); |
345 |
< |
} catch(ArrayStoreException e){} |
345 |
> |
} catch (ArrayStoreException e){} |
346 |
|
} |
347 |
|
|
348 |
|
/** |
353 |
|
List c = emptyArray(); |
354 |
|
c.get(-1); |
355 |
|
shouldThrow(); |
356 |
< |
} catch(IndexOutOfBoundsException e){} |
356 |
> |
} catch (IndexOutOfBoundsException e){} |
357 |
|
} |
358 |
|
|
359 |
|
/** |
366 |
|
c.add("asdad"); |
367 |
|
c.get(100); |
368 |
|
shouldThrow(); |
369 |
< |
} catch(IndexOutOfBoundsException e){} |
369 |
> |
} catch (IndexOutOfBoundsException e){} |
370 |
|
} |
371 |
|
|
372 |
|
/** |
377 |
|
List c = emptyArray(); |
378 |
|
c.set(-1,"qwerty"); |
379 |
|
shouldThrow(); |
380 |
< |
} catch(IndexOutOfBoundsException e){} |
380 |
> |
} catch (IndexOutOfBoundsException e){} |
381 |
|
} |
382 |
|
|
383 |
|
/** |
390 |
|
c.add("asdad"); |
391 |
|
c.set(100, "qwerty"); |
392 |
|
shouldThrow(); |
393 |
< |
} catch(IndexOutOfBoundsException e){} |
393 |
> |
} catch (IndexOutOfBoundsException e){} |
394 |
|
} |
395 |
|
|
396 |
|
/** |
401 |
|
List c = emptyArray(); |
402 |
|
c.add(-1,"qwerty"); |
403 |
|
shouldThrow(); |
404 |
< |
} catch(IndexOutOfBoundsException e){} |
404 |
> |
} catch (IndexOutOfBoundsException e){} |
405 |
|
} |
406 |
|
|
407 |
|
/** |
414 |
|
c.add("asdasdasd"); |
415 |
|
c.add(100, "qwerty"); |
416 |
|
shouldThrow(); |
417 |
< |
} catch(IndexOutOfBoundsException e){} |
417 |
> |
} catch (IndexOutOfBoundsException e){} |
418 |
|
} |
419 |
|
|
420 |
|
/** |
425 |
|
List c = emptyArray(); |
426 |
|
c.remove(-1); |
427 |
|
shouldThrow(); |
428 |
< |
} catch(IndexOutOfBoundsException e){} |
428 |
> |
} catch (IndexOutOfBoundsException e){} |
429 |
|
} |
430 |
|
|
431 |
|
/** |
438 |
|
c.add("adasdasd"); |
439 |
|
c.remove(100); |
440 |
|
shouldThrow(); |
441 |
< |
} catch(IndexOutOfBoundsException e){} |
441 |
> |
} catch (IndexOutOfBoundsException e){} |
442 |
|
} |
443 |
|
|
444 |
|
/** |
449 |
|
List c = emptyArray(); |
450 |
|
c.addAll(-1,new LinkedList()); |
451 |
|
shouldThrow(); |
452 |
< |
} catch(IndexOutOfBoundsException e){} |
452 |
> |
} catch (IndexOutOfBoundsException e){} |
453 |
|
} |
454 |
|
|
455 |
|
/** |
462 |
|
c.add("asdasdasd"); |
463 |
|
c.addAll(100, new LinkedList()); |
464 |
|
shouldThrow(); |
465 |
< |
} catch(IndexOutOfBoundsException e){} |
465 |
> |
} catch (IndexOutOfBoundsException e){} |
466 |
|
} |
467 |
|
|
468 |
|
/** |
473 |
|
List c = emptyArray(); |
474 |
|
c.listIterator(-1); |
475 |
|
shouldThrow(); |
476 |
< |
} catch(IndexOutOfBoundsException e){} |
476 |
> |
} catch (IndexOutOfBoundsException e){} |
477 |
|
} |
478 |
|
|
479 |
|
/** |
486 |
|
c.add("asdasdas"); |
487 |
|
c.listIterator(100); |
488 |
|
shouldThrow(); |
489 |
< |
} catch(IndexOutOfBoundsException e){} |
489 |
> |
} catch (IndexOutOfBoundsException e){} |
490 |
|
} |
491 |
|
|
492 |
|
/** |
498 |
|
c.subList(-1,100); |
499 |
|
|
500 |
|
shouldThrow(); |
501 |
< |
} catch(IndexOutOfBoundsException e){} |
501 |
> |
} catch (IndexOutOfBoundsException e){} |
502 |
|
} |
503 |
|
|
504 |
|
/** |
510 |
|
c.add("asdasd"); |
511 |
|
c.subList(1,100); |
512 |
|
shouldThrow(); |
513 |
< |
} catch(IndexOutOfBoundsException e){} |
513 |
> |
} catch (IndexOutOfBoundsException e){} |
514 |
|
} |
515 |
|
|
516 |
|
/** |
523 |
|
c.subList(3,1); |
524 |
|
|
525 |
|
shouldThrow(); |
526 |
< |
} catch(IndexOutOfBoundsException e){} |
526 |
> |
} catch (IndexOutOfBoundsException e){} |
527 |
|
} |
528 |
|
|
529 |
|
|