void () { final MyQueue queue = new MyQueue(); final AtomicInteger count = new AtomicInteger(); for (int i = 0; i < 100; i++) { for (int j = 0; j < 100; j++) { queue.queue(new Update("foo" + j) { @Override public void run() { count.incrementAndGet(); } }); } } queue.showNotify(); waitForExecution(queue); assertEquals(100, count.get()); }