code: private Template findCachedTemplate(String key, File file) {
          Template template = null;
  
          /*
           * Test cache for a valid template bound to the key.
           */
          if (verbose) {
              log("Looking for cached template by key \"" + key + "\"");
          }
          
          TemplateCacheEntry entry = (TemplateCacheEntry) cache.get(key);
          if (entry != null) {
              if (entry.validate(file)) {
                  if (verbose) {
                      log("Cache hit! " + entry);
                  }
                  template = entry.template;
              } else {
                  if (verbose) {
                      log("Cached template " + key + " needs recompiliation! " + entry);
                  }
              }
          } else {
              if (verbose) {
                  log("Cache miss for " + key);
              }
          }
  
          return template;
      }
docs: Find a cached template for a given key. If a <code>File</code> is passed then
  any cached object is validated against the File to determine if it is out of
  date
  @param key a unique key for the template, such as a file's absolutePath or a URL.
  @param file a file to be used to determine if the cached template is stale. May be null.
  @return The cached template, or null if there was no cached entry, or the entry was stale.