code: public static Batch batchWithCount( Batch batch ) {
          if (batch == null || batch.isEmpty() || batch.rowCount() >= 0 || batch.width() < 1) return batch;
          // Otherwise, the batch doesn't know it's row count, so we have to copy it ...
          return batch.width() == 1 ? new SingleWidthBatch(batch) : new MultiWidthBatch(batch);
      }
docs: Create a batch that always has a {@link Batch#rowCount()}, even if that means returning a new Batch that buffers the
  original's rows it into memory.
  
  @param batch the original batch; may be null
  @return the batch that has a true {@link Batch#rowCount()}, or the original batch if null or empty or if the original has a
  non-negative row count