Code example for BlockingQueue

Methods: peek

0
        }; 
    } 
 
    @Override 
    public E peek() { 
        return queue.peek();
    } 
 
    @Override 
    public E poll() { 
        E e = queue.poll();
        if (e != null) {
            size.decrementAndGet();
        } 
        return e;
    } 
 
    @Override 
    public E poll(long timeout, TimeUnit unit) throws InterruptedException {
        E e = queue.poll(timeout, unit);
        if (e != null) {