import java.util.*; class Main { static Deque queue; static ArrayQueue concurrentQueue; static List[] deqValues; static int TH = 10, NUM = 1000; // Each unsafe thread enqs N numbers and deqs N, adding // them to its own deqValues for checking; using Java's // sequential queue implementation, ArrayDeque. static Thread unsafe(int id, int x, int N) { return new Thread(() -> { String action = "enq"; try { for (int i=0, y=x; i { String action = "enq"; try { for (int i=0, y=x; i set = new HashSet<>(); boolean passed = true; for (int i=0; i(); concurrentQueue = new ArrayQueue<>(TH*NUM); deqValues = new List[TH]; for (int i=0; i(); Thread[] threads = new Thread[TH]; for (int i=0; i