35 |
|
Collection<Integer>[] colls = |
36 |
|
(Collection<Integer>[])new Collection[NC]; |
37 |
|
|
38 |
< |
for (int k = 0; k < colls.length; ++k) |
39 |
< |
colls[k] = (Collection<Integer>)klass.newInstance(); |
38 |
> |
for (int k = 0; k < colls.length; ++k) { |
39 |
> |
Object x = klass.newInstance(); |
40 |
> |
if (x instanceof Collection) |
41 |
> |
colls[k] = (Collection<Integer>)x; |
42 |
> |
else if (x instanceof Map) |
43 |
> |
colls[k] = (Collection<Integer>)Collections.newSetFromMap((Map)x); |
44 |
> |
else |
45 |
> |
throw new Error("bad class"); |
46 |
> |
} |
47 |
|
|
48 |
|
for (int i = 0; i < t; ++i) |
49 |
|
new IteratorLoops(colls).oneRun(n); |