src/main/java/com/paul/design/Observer/BlockQueue.java
public synchronized  String take() throws InterruptedException {
        while (queue.size()==0){
            this.wait();
        }
        this.notifyAll();
        return queue.remove();
    }
/**
     * Retrieves and removes the head of this queue, waiting if necessary
     * until an element becomes available.
     *
     * @return the head of this queue
     * @throws InterruptedException if interrupted while waiting
     */
Retrieves and removes the head of this queue, waiting if necessary
until an element becomes available.

@return the head of this queue
@throws InterruptedException if interrupted while waiting
Retrieves and removes the head of this queue waiting if necessary until an element becomes available . @return the head of this queue @throws InterruptedException if interrupted while waiting
public synchronized  String take() throws InterruptedException {
        while (queue.size()==0){
            this.wait();
        }
        this.notifyAll();
        return queue.remove();
    }
public synchronized String take ( ) throws InterruptedException { while ( queue . size ( ) == 0 ) { this . wait ( ) ; } this . notifyAll ( ) ; return queue . remove ( ) ; }
Retrieves and removes the head of this queue, waiting if necessary
 until an element becomes available.
Retrieves and removes the head of this queue waiting if necessary until an element becomes available .