code: public static NodeSequence withBatches( final Iterator<Batch> batches,
                                              final int width,
                                              final long rowCount ) {
          assert rowCount >= -1;
          if (batches == null) return emptySequence(width);
          return new NodeSequence() {
              @Override
              public int width() {
                  return width;
              }
  
              @Override
              public long getRowCount() {
                  return rowCount;
              }
  
              @Override
              public boolean isEmpty() {
                  return rowCount == 0;
              }
  
              @Override
              public Batch nextBatch() {
                  return batches.hasNext() ? batches.next() : null;
              }
  
              @Override
              public void close() {
              }
  
              @Override
              public String toString() {
                  return "(sequence width=" + width() + " (iterator<batch>) )";
              }
          };
      }
docs: Create a sequence of nodes that iterates over the supplied batches of nodes. Note that the supplied iterator is accessed
  lazily as the resulting sequence instance is {@link #nextBatch() used}.
  
  @param batches the iterator over the nodes to be returned; if null, an {@link #emptySequence empty instance} is returned
  @param width the width of the batch; must be positive, and must be the width of all the batches
  @param rowCount the number of rows in the batches; must be -1 if not known, 0 if known to be empty, or a positive number if
  the number of rows is known
  @return the sequence of nodes; never null
  @see #withBatches(Collection, int)