code: public void updateNodes(Iterator<String> remove, Iterator<NodeData> add) throws RepositoryException, IOException
     {
        while (remove.hasNext())
        {
           deleteNode(remove.next());
        }
        while (add.hasNext())
        {
           addNode(add.next());
        }
     }
docs: This default implementation calls the individual {@link #deleteNode(String)}
  and {@link #addNode(NodeData)} methods
  for each entry in the iterators. First the nodes to remove are processed
  then the nodes to add.
  
  @param remove uuids of nodes to remove.
  @param add NodeStates to add.
  @throws RepositoryException if an error occurs while indexing a node.
  @throws IOException if an error occurs while updating the index.