code: protected int scoreByMediaType(List<MediaType> mediaTypes, MediaType requiredMediaType) {
          int score = MAXIMUM_HEADER_SCORE;
          boolean match = false;
          boolean matchWildCard = false;
          for (MediaType mediaType : mediaTypes) {
              if (mediaType.matches(requiredMediaType)) {
                  if (mediaType.isWildCardMediaType()) {
                      matchWildCard = true;
                  }
                  match = true;
                  break;
              }
  
              // Lower the score for each subsequent possible match
              score -= 2;
          }
          return match && !matchWildCard ? score : matchWildCard ? WILDCARD_MATCH_SCORE : DEFAULT_SCORE;
      }
docs: Computes a score by examining a list of media types (typically from the 'Accept' header) against
  a required media type.
  
  @param mediaTypes        The list of media types to examine.
  @param requiredMediaType The required media type.
  @return A score that indicates if one of the media types in the list matches the required media type.