code: public static List<File> filterFiles(final List<File> files, final Filter<File> acceptFilter, final Log log) {
  
          // Check sanity
          Validate.notNull(files, "files");
  
          final List<File> toReturn = new ArrayList<File>();
  
          if (files.size() > 0) {
              for (File current : files) {
  
                  final boolean isAcceptedFile = EXISTING_FILE.accept(current) && acceptFilter.accept(current);
                  final boolean isAcceptedDirectory = EXISTING_DIRECTORY.accept(current) && acceptFilter.accept(current);
  
                  if (isAcceptedFile) {
                      toReturn.add(current);
                  } else if (isAcceptedDirectory) {
                      recurseAndPopulate(toReturn, Collections.singletonList(acceptFilter), current, false, log);
                  }
              }
          }
  
          // All done
          return toReturn;
      }
docs: Filters all supplied files using the provided {@code acceptFilter}.
  
  @param files        The list of files to resolve, filter and return. If the {@code files} List
  contains directories, they are searched for Files recursively. Any found Files in such
  a search are included in the resulting File List if they match the acceptFilter supplied.
  @param acceptFilter A filter matched to all files in the given List. If the acceptFilter matches a file, it is
  included in the result.
  @param log          The active Maven Log.
  @return All files in (or files in subdirectories of directories provided in) the files List, provided that each
  file is accepted by an ExclusionRegExpFileFilter.