code: public static void sortBySpecificityAndQuality(List<MediaType> mediaTypes) {
          checkNotNull(mediaTypes, "'mediaTypes' must not be null");
          if (mediaTypes.size() > 1) {
              Collections.sort(mediaTypes, Ordering.compound(
                      ImmutableList.of(MediaType.SPECIFICITY_COMPARATOR, MediaType.QUALITY_VALUE_COMPARATOR)));
          }
      }
docs: Sorts the given list of {@code MediaType} objects by specificity as the
  primary criteria and quality value the secondary.
  
  @see MediaType#sortBySpecificity(List)
  @see MediaType#sortByQualityValue(List)