code: public MimeType getPreferredAccept(Set<MimeType> supportedTypes) {
          // Starts from the highest.
          for (AcceptHeaderEntry clientSupported : entries) {
              for (MimeType serverSupported : supportedTypes) {
                  if (isSameOrSubtype(serverSupported, clientSupported.mediaType)) {
                      return serverSupported;
                  }
              }
          }
  
          return null;
      }
docs: Given a set of supported {@link MimeType}s, returns the one that best
  satisfies this accept header.
  
  @param supportedTypes a set of supported {@link MimeType}s.
  @return the best candidate in the set, or <code>null</code> if the
  header does not allow any of supported {@link MimeType}s.