5 |
|
* http://creativecommons.org/publicdomain/zero/1.0/ |
6 |
|
*/ |
7 |
|
|
8 |
– |
import java.util.ArrayList; |
8 |
|
import java.util.Arrays; |
9 |
|
import java.util.Collection; |
10 |
|
import java.util.Collections; |
29 |
|
} |
30 |
|
class SubListImplementation extends Implementation { |
31 |
|
public List emptyCollection() { |
32 |
< |
return super.emptyCollection().subList(0, 0); |
32 |
> |
List list = super.emptyCollection(); |
33 |
> |
ThreadLocalRandom rnd = ThreadLocalRandom.current(); |
34 |
> |
if (rnd.nextBoolean()) |
35 |
> |
list.add(makeElement(rnd.nextInt())); |
36 |
> |
int i = rnd.nextInt(list.size() + 1); |
37 |
> |
return list.subList(i, i); |
38 |
|
} |
39 |
|
} |
40 |
|
return newTestSuite( |