code: public static boolean hasExtension(File file, String... extensions) {
          String extension = FilenameUtils.getExtension(file.getName());
          for (String s : extensions) {
              if (extension.equalsIgnoreCase(s) || ("." + extension).equalsIgnoreCase(s)) {
                  return true;
              }
          }
          return false;
      }
docs: Checks whether the given file has one of the given extension.
  
  @param file       the file
  @param extensions the extensions
  @return {@literal true} if the file has one of the given extension, {@literal false} otherwise