code: private void checkAndNotify(final FileStatusEntry parent, final FileStatusEntry[] previous, final Path[] currentPaths)
        throws IOException {
  
      int c = 0;
      final FileStatusEntry[] current =
          currentPaths.length > 0 ? new FileStatusEntry[currentPaths.length] : FileStatusEntry.EMPTY_ENTRIES;
      for (final FileStatusEntry previousEntry : previous) {
        while (c < currentPaths.length && comparator.compare(previousEntry.getPath(), currentPaths[c]) > 0) {
          current[c] = createPathEntry(parent, currentPaths[c]);
          doCreate(current[c]);
          c++;
        }
        if (c < currentPaths.length && comparator.compare(previousEntry.getPath(), currentPaths[c]) == 0) {
          doMatch(previousEntry, currentPaths[c]);
          checkAndNotify(previousEntry, previousEntry.getChildren(), listPaths(currentPaths[c]));
          current[c] = previousEntry;
          c++;
        } else {
          checkAndNotify(previousEntry, previousEntry.getChildren(), EMPTY_PATH_ARRAY);
          doDelete(previousEntry);
        }
      }
  
      for (; c < currentPaths.length; c++) {
        current[c] = createPathEntry(parent, currentPaths[c]);
        doCreate(current[c]);
      }
      parent.setChildren(current);
    }
docs: Compare two file lists for files which have been created, modified or deleted.
  
  @param parent The parent entry
  @param previous The original list of paths
  @param currentPaths The current list of paths