code: public List<Attribute> read(int limit) throws InterruptedException {
          // blocks until the queue contains at least 1 element
          while (queue.isEmpty()) {
              synchronized (this) {
                  wait();
              }
          }
  
          return queue.values().stream().limit(limit).collect(Collectors.toList());
      }
docs: Read at most N attributes from the beginning of the queue. Read everything if there are less than N attributes in the queue.
  If the queue is empty, the method will block until the queue receives a new attribute.
  The attributes won't be removed from the queue until you call {@link #ack(List<Attribute>)} on the returned attributes.
  
  @param limit the maximum number of items to be returned.
  @return a list of {@link Attribute}
  @throws InterruptedException
  @see #ack(List<Attribute>)