code: public Optional<MediaType> matchHeaders(Iterable<? extends CharSequence> acceptHeaders) {
          requireNonNull(acceptHeaders, "acceptHeaders");
  
          final List<MediaType> ranges = new ArrayList<>(4);
          for (CharSequence acceptHeader : acceptHeaders) {
              addRanges(ranges, acceptHeader);
          }
          return match(ranges);
      }
docs: Finds the {@link MediaType} in this {@link List} that matches one of the media ranges specified in the
  specified string.
  
  @param acceptHeaders the values of the {@code "accept"} header, as defined in
  <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">the section 14.1, RFC2616</a>
  @return the most preferred {@link MediaType} that matches one of the specified media ranges.
  {@link Optional#empty()} if there are no matches or {@code acceptHeaders} does not contain
  any valid ranges.