code: public static Batch batchOf( final Iterator<CachedNode> nodes,
                                   final long nodeCount,
                                   final float score,
                                   final String workspaceName ) {
          assert nodeCount >= -1;
          if (nodes == null) return emptyBatch(workspaceName, 1);
          return new Batch() {
              private CachedNode current;
  
              @Override
              public int width() {
                  return 1;
              }
  
              @Override
              public long rowCount() {
                  return nodeCount;
              }
  
              @Override
              public boolean isEmpty() {
                  return nodeCount == 0;
              }
  
              @Override
              public String getWorkspaceName() {
                  return workspaceName;
              }
  
              @Override
              public boolean hasNext() {
                  return nodes.hasNext();
              }
  
              @Override
              public void nextRow() {
                  current = nodes.next();
              }
  
              @Override
              public CachedNode getNode() {
                  return current;
              }
  
              @Override
              public CachedNode getNode( int index ) {
                  if (index != 0) throw new IndexOutOfBoundsException();
                  return current;
              }
  
              @Override
              public float getScore() {
                  return score;
              }
  
              @Override
              public float getScore( int index ) {
                  if (index != 0) throw new IndexOutOfBoundsException();
                  return score;
              }
  
              @Override
              public String toString() {
                  return "(batch node-count=" + rowCount() + " score=" + getScore() + " )";
              }
          };
      }
docs: Create a batch of nodes around the supplied iterator. Note that the supplied iterator is accessed lazily only when the
  batch is {@link Batch#nextRow() used}.
  
  @param nodes the iterator over the nodes to be returned; if null, an {@link #emptySequence empty instance} is returned
  @param nodeCount the number of nodes in the iterator; must be -1 if not known, 0 if known to be empty, or a positive number
  if the number of nodes is known
  @param score the score to return for all of the nodes
  @param workspaceName the name of the workspace in which all of the nodes exist
  @return the batch of nodes; never null