code: private static File getMatchingFile(File folder, FilenameFilter filter) {
          File result = null;
          final File[] matches = folder.listFiles(filter);
          if (null != matches && 1 == matches.length) {
              result = matches[0];
          }
          return result;
      }
docs: Returns a list of files that match the given filter, this does not
  recursively scan the directory.
  
  @param folder the folder to filter
  @param filter the filter to apply to the files in the directory
  @return the list of Files in the directory that match the provided filter