code: public static Collection<File> getAllFilesFromDirectory(File directory, List<String> extensions) {
          if (directory.isDirectory()) {
              return FileUtils.listFiles(directory,
                      extensions.toArray(new String[extensions.size()]), true);
          }
          return Collections.emptyList();
      }
docs: Gets all the file from the given directory having one of the specified extension. The lookup is recursive (so
  searches in nested directories). If the given directory does not exist or is not a directory,
  this method returns an empty collection.
  
  @param directory  the directory
  @param extensions the set of extension
  @return the set of file, potentially empty