code: public ChangesHolder getChanges(final Set<String> removedNodes, final Set<String> addedNodes)
     {
        if (handler != null)
        {
           Iterator<NodeData> addedStates = new Iterator<NodeData>()
           {
              private final Iterator<String> iter = addedNodes.iterator();
  
              public boolean hasNext()
              {
                 return iter.hasNext();
              }
  
              public NodeData next()
              {
  
                 // cycle till find a next or meet the end of set
                 do
                 {
                    String id = iter.next();
                    try
                    {
                       ItemData item = itemMgr.getItemData(id);
                       if (item != null)
                       {
                          if (item.isNode())
                          {
                             if (!indexingTree.isExcluded(item))
                             {
                                return (NodeData)item;
                             }
                          }
                          else
                          {
                             LOG.warn("Node not found, but property " + id + ", " + item.getQPath().getAsString()
                                + " found. ");
                          }
                       }
                       else
                       {
                          LOG.warn("Unable to index node with id " + id + ", node does not exist.");
                       }
  
                    }
                    catch (RepositoryException e)
                    {
                       LOG.error("Can't read next node data " + id, e);
                    }
                 }
                 while (iter.hasNext()); // get next if error or node not found
  
                 return null; // we met the end of iterator set
              }
  
              public void remove()
              {
                 throw new UnsupportedOperationException();
              }
           };
  
           Iterator<String> removedIds = new Iterator<String>()
           {
              private final Iterator<String> iter = removedNodes.iterator();
  
              public boolean hasNext()
              {
                 return iter.hasNext();
              }
  
              public String next()
              {
                 return nextNodeId();
              }
  
              public String nextNodeId() throws NoSuchElementException
              {
                 return iter.next();
              }
  
              public void remove()
              {
                 throw new UnsupportedOperationException();
  
              }
           };
  
           if (removedNodes.size() > 0 || addedNodes.size() > 0)
           {
              return handler.getChanges(removedIds, addedStates);
           }
        }
        return null;
     }
docs: Extracts all the changes and returns them as a {@link ChangesHolder} instance