assert queue.size() == 0;
}
public static void testWaitUntilClosed4() throws QueueClosedException {
final Queue queue=new Queue();
for(int i=0; i < 10; i++)
queue.add(new Integer(i));
new Thread() {
public void run() {
while(!queue.closed()) {
try {
System.out.println("-- removed " + queue.remove());
Util.sleep(200);
}
catch(QueueClosedException e) {
break;
}
}
}
}.start();
queue.close(true);
queue.waitUntilClosed(0);
assert queue.size() == 0;
}