30 |
|
* @key randomness |
31 |
|
*/ |
32 |
|
|
33 |
– |
import java.util.*; |
34 |
– |
import java.util.function.Supplier; |
35 |
– |
import org.testng.annotations.Test; |
33 |
|
import org.testng.annotations.DataProvider; |
34 |
+ |
import org.testng.annotations.Test; |
35 |
+ |
|
36 |
+ |
import java.util.ArrayList; |
37 |
+ |
import java.util.Arrays; |
38 |
+ |
import java.util.Collection; |
39 |
+ |
import java.util.Collections; |
40 |
+ |
import java.util.HashSet; |
41 |
+ |
import java.util.Iterator; |
42 |
+ |
import java.util.List; |
43 |
+ |
import java.util.Random; |
44 |
+ |
import java.util.Set; |
45 |
+ |
import java.util.TreeSet; |
46 |
+ |
import java.util.function.Supplier; |
47 |
|
|
38 |
– |
import static org.testng.Assert.fail; |
48 |
|
import static org.testng.Assert.assertTrue; |
49 |
+ |
import static org.testng.Assert.fail; |
50 |
|
|
51 |
|
public class CheckedSetBash { |
52 |
|
static final int numItr = 100; |
132 |
|
} |
133 |
|
|
134 |
|
static void AddRandoms(Set s, int n) { |
135 |
< |
for (int i=0; i<n; i++) { |
136 |
< |
int r = rnd.nextInt() % n; |
127 |
< |
Integer e = new Integer(r < 0 ? -r : r); |
135 |
> |
for (int i = 0; i < n; i++) { |
136 |
> |
Integer e = rnd.nextInt(n); |
137 |
|
|
138 |
|
int preSize = s.size(); |
139 |
|
boolean prePresent = s.contains(e); |