code: public static FileFilter adapt(final Filter<File> toAdapt) {
  
          // Check sanity
          Validate.notNull(toAdapt, "toAdapt");
  
          // Already a FileFilter?
          if (toAdapt instanceof FileFilter) {
              return (FileFilter) toAdapt;
          }
  
          // Wrap and return.
          return new FileFilter() {
              @Override
              public boolean accept(final File candidate) {
                  return toAdapt.accept(candidate);
              }
          };
      }
docs: Adapts the Filter specification to the FileFilter interface, to enable immediate use
  for filtering File lists.
  
  @param toAdapt The non-null Filter which should be adapted to a FileFilter interface.
  @return If the {@code toAdapt} instance already implements the FileFilter interface, simply return the toAdapt
  instance. Otherwise, returns a FileFilter interface which delegates its execution to the wrapped Filter.