public synchronized void add(E newValue) throws InterruptedException{ while (size == elements.length) wait(); elements[tail] = anObject; . . . notifyAll(); // notifies threads waiting to remove elements}