code: private void scanFile(LinkedHashMap<String, FileInfo> cacheMap, LinkedHashMap<String, FileInfo> newMap, File f, Collection<File> created, Collection<File> modified,
                            final boolean isFile) {
          String key = f.getAbsolutePath();
  
          // !REMOVE! we saw it in this scan, it's still here.
          // Removing items we've seen from the cacheMap allows us to identify deleted resources: 
          // they will be the only items left in the cacheMap when we've completed the scan.
  
          FileInfo cachedValue = null;
          if (cacheMap != null) {
              cachedValue = cacheMap.remove(key);
          }
  
          long fileModified = f.lastModified();
          long fileSize = f.length();
  
          final FileInfo newValue;
          if (cachedValue == null) {
              newValue = new FileInfo(isFile, fileModified, fileSize);
              // If we have no cached value, add the file to the list of created resources
              addToList(created, f);
          } else if (cachedValue.hasChanged(isFile, fileModified, fileSize)) {
              newValue = new FileInfo(isFile, fileModified, fileSize);
              // If the modified time or file size have changed since we last looked, 
              // add the file to the list of modified resources
              addToList(modified, f);
          } else {
              newValue = cachedValue;
          }
  
          // set the new value in the map
          newMap.put(key, newValue);
      }
docs: Scan a given file (remove from cacheMap as "seen", test for match against filter for
  addition to created/modified list, add new file attributes to the new map).
  <p>
  Assumes only one scan is active at a time.
  
  @param cacheMap The map of file information from the previous scan
  @param newMap The map of information for files/directories found in this scan
  @param f A file or directory to inspect for changes
  @param created A list containing files that were not found in the previous scan
  @param modified A list containing files whose attributes have changed since the previous scan
  @param isFile true if this is a file