* Two read threads should block on an empty buffer until a
* singleton is added then both threads should complete.
*/
public void testBlockedGetWithAddAll() {
Buffer blockingBuffer = BlockingBuffer.decorate(new MyBuffer());
Object obj = new Object();
// run methods will get and compare -- must wait for addAll
Thread thread1 = new ReadThread(blockingBuffer, obj);
Thread thread2 = new ReadThread(blockingBuffer, obj);
thread1.start();
thread2.start();
// give hungry read threads ample time to hang
delay();
// notifyAll should allow both read threads to complete
blockingBuffer.addAll(Collections.singleton(obj));
// allow notified threads to complete
delay();
// There should not be any threads waiting.