public static <FF extends FileFormat>Optional<FF> matchMIMEType(String mimeType,Iterable<FF> fileFormats){
  for (  FF fileFormat : fileFormats) {
    if (fileFormat.hasDefaultMIMEType(mimeType)) {
      return Optional.of(fileFormat);
    }
  }
  for (  FF fileFormat : fileFormats) {
    if (fileFormat.hasMIMEType(mimeType)) {
      return Optional.of(fileFormat);
    }
  }
  return Optional.empty();
}

public static < FF extends FileFormat > Optional < FF > matchMIMEType ( String mimeType , Iterable < FF > fileFormats ) { for ( FF fileFormat : fileFormats ) { if ( fileFormat . hasDefaultMIMEType ( mimeType ) ) { return Optional . of ( fileFormat ) ; } } for ( FF fileFormat : fileFormats ) { if ( fileFormat . hasMIMEType ( mimeType ) ) { return Optional . of ( fileFormat ) ; } } return Optional . empty ( ) ; }
tries to match the specified mime type with the mime types of the supplied file formats .
