code: public Object get()
          throws InterruptedException
      {
          synchronized(lock)
          {
              while (size==0)
                  lock.wait();
              
              Object o = elements[head];
              elements[head]=null;
              if(++head==maxSize)
                  head=0;
              if (size==maxSize)
                  lock.notifyAll();
              size--;
              return o;
          }
      }
docs: Get object from queue.
  Block if there are no objects to get.
  @return The next object in the queue.