108 |
|
|
109 |
|
List even = clone(s); |
110 |
|
Iterator it = even.iterator(); |
111 |
< |
while(it.hasNext()) |
112 |
< |
if(((Integer)it.next()).intValue() % 2 == 1) |
111 |
> |
while (it.hasNext()) |
112 |
> |
if (((Integer)it.next()).intValue() % 2 == 1) |
113 |
|
it.remove(); |
114 |
|
it = even.iterator(); |
115 |
< |
while(it.hasNext()) |
116 |
< |
if(((Integer)it.next()).intValue() % 2 == 1) |
115 |
> |
while (it.hasNext()) |
116 |
> |
if (((Integer)it.next()).intValue() % 2 == 1) |
117 |
|
fail("Failed to remove all odd nubmers."); |
118 |
|
|
119 |
|
List odd = clone(s); |
120 |
|
for (int i=0; i<(listSize/2); i++) |
121 |
|
odd.remove(i); |
122 |
|
for (int i=0; i<(listSize/2); i++) |
123 |
< |
if(((Integer)odd.get(i)).intValue() % 2 != 1) |
123 |
> |
if (((Integer)odd.get(i)).intValue() % 2 != 1) |
124 |
|
fail("Failed to remove all even nubmers."); |
125 |
|
|
126 |
|
List all = clone(odd); |
144 |
|
} |
145 |
|
itAll = all.listIterator(); |
146 |
|
it = s.iterator(); |
147 |
< |
while(it.hasNext()) |
148 |
< |
if(it.next()==itAll.next()) |
147 |
> |
while (it.hasNext()) |
148 |
> |
if (it.next()==itAll.next()) |
149 |
|
fail("Iterator.set failed to change value."); |
150 |
|
if (!all.equals(s)) |
151 |
|
fail("Failed to reconstruct ints with ListIterator."); |