docs: public int add(final MessageBatch batch, boolean resize) {
          if(batch == null) return 0;
          if(this == batch)
              throw new IllegalArgumentException("cannot add batch to itself");
          int batch_size=batch.size();
          if(index+batch_size >= messages.length && resize)
              resize(messages.length + batch_size + 1);
  
          int cnt=0;
          for(Message msg: batch) {
              if(index >= messages.length)
                  return cnt;
              messages[index++]=msg;
              cnt++;
          }
          return cnt;
      }