26 |
|
* @bug 4904067 |
27 |
|
* @summary Unit test for Collections.checkedList |
28 |
|
* @author Josh Bloch |
29 |
+ |
* @key randomness |
30 |
|
*/ |
31 |
|
|
32 |
|
import java.util.*; |
202 |
|
} |
203 |
|
|
204 |
|
static List newList() { |
205 |
< |
List s = Collections.checkedList(new ArrayList(), Integer.class); |
205 |
> |
List s = Collections.checkedList(new ArrayList(), Integer.class); |
206 |
|
if (!s.isEmpty()) |
207 |
|
fail("New instance non empty."); |
208 |
|
return s; |
215 |
|
|
216 |
|
int preSize = s.size(); |
217 |
|
if (!s.add(e)) |
218 |
< |
fail("Add failed."); |
218 |
> |
fail ("Add failed."); |
219 |
|
int postSize = s.size(); |
220 |
|
if (postSize-preSize != 1) |
221 |
< |
fail("Add didn't increase size by 1."); |
221 |
> |
fail ("Add didn't increase size by 1."); |
222 |
|
} |
223 |
|
} |
224 |
|
|