import java.util.*;
import java.util.zip.*;
import java.util.List;
import java.util.regex.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
import java.util.function.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.table.*;
import java.io.*;
import java.net.*;
import java.lang.reflect.*;
import java.lang.ref.*;
import java.lang.management.*;
import java.security.*;
import java.security.spec.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.awt.geom.*;
import javax.imageio.*;
import java.math.*;
// uses Int as values by default
import java.text.NumberFormat;
import java.awt.geom.*;
import static x30_pkg.x30_util.DynamicObject;
class main {
abstract static class TestUnorderedSet {
HashSet a = new HashSet();
Set b;
final public TestUnorderedSet setRandomSeed(Integer randomSeed){ return randomSeed(randomSeed); }
public TestUnorderedSet randomSeed(Integer randomSeed) { this.randomSeed = randomSeed; return this; } final public Integer getRandomSeed(){ return randomSeed(); }
public Integer randomSeed() { return randomSeed; }
Integer randomSeed;
abstract Set makeSet();
int n = 1000, valueRange = 100;
boolean remove = true;
Object makeEntry() { return random(valueRange); }
Object randomNonContainedEntry() { return random(valueRange+1, valueRange*2); }
String moreInfo(Set b) { return ""; }
void printStats() {
print(joinNemptiesWithSlash(n2(b), moreInfo(b)) + " - " + takeFirst(10, b.iterator()));
print(/*"Size HashSet: " + n2(deepObjectSize(a))*/
"Size " + shortClassName(b) + ": " + n2(deepObjectSize(b)));
}
public void run() { try {
AutoCloseable __3 = tempSetRandomSeedUnlessNull(randomSeed); try {
b = makeSet();
printStats();
for (int _repeat_0 = 0; _repeat_0 < n; _repeat_0++) {
var o = makeEntry();
boolean change = addToTwoCollections(a, b, o);
print((change ? "Added " : "Already contained ") + o);
if (remove) {
o = makeEntry();
change = removeFromTwoCollections(a, b, o);
print((change ? "Removed " : "Didn't contain ") + o);
}
assertSetsEqual(a, b);
for (int _repeat_1 = 0; _repeat_1 < 5; _repeat_1++) { assertFalse(b.contains(randomNonContainedEntry())); }
printStats();
}
} finally { _close(__3); }} catch (Exception __e) { throw rethrow(__e); } }
}
static int random(int n) { return random(n, defaultRandomGenerator()); }
static int random(int n, Random r) {
return random(r, n);
}
static int random(Random r, int n) {
return n <= 0 ? 0 : getRandomizer(r).nextInt(n);
}
static double random(double max) {
return random()*max;
}
static double random() {
return defaultRandomGenerator().nextInt(100001)/100000.0;
}
static double random(double min, double max) {
return min+random()*(max-min);
}
// min <= value < max
static int random(int min, int max) {
return min+random(max-min);
}
static int random(int min, int max, Random r) {
return random(r, min, max);
}
static int random(Random r, int min, int max) {
return min+random(r, max-min);
}
static A random(List l) {
return oneOf(l);
}
static A random(Collection c) {
if (c instanceof List) return random((List) c);
int i = random(l(c));
return collectionGet(c, i);
}
static Pair random(Map map) {
return entryToPair(random(entries(map)));
}
static volatile StringBuffer local_log = new StringBuffer(); // not redirected
static boolean printAlsoToSystemOut = true;
static volatile Appendable print_log = local_log; // might be redirected, e.g. to main bot
// in bytes - will cut to half that
static volatile int print_log_max = 1024*1024;
static volatile int local_log_max = 100*1024;
static boolean print_silent = false; // total mute if set
static Object print_byThread_lock = new Object();
static volatile ThreadLocal