code: public Object dequeue(final long timeout) throws TimeoutException, ClosedException, InterruptedException {
          return list.remove(timeout == 0 ? this.timeout : timeout);
      }
docs: Return first element of the underlying list and remove it. If no element exists, wait (max. timeout milliseconds)
  until the queue is filled again.
  
  @param timeout
  0 to disable timeout
  @return the first queue element
  @throws TimeoutException
  Thrown if timeout is reached while waiting for data in queue
  @throws ClosedException
  Thrown if queue is already closed
  @throws InterruptedException
  Might be thrown by the internally used Java-wait method.