code: @Override
      public int compareTo(MimeType other) {
          int comp = getType().compareToIgnoreCase(other.getType());
          if (comp != 0) {
              return comp;
          }
          comp = getSubtype().compareToIgnoreCase(other.getSubtype());
          if (comp != 0) {
              return comp;
          }
          comp = getParameters().size() - other.getParameters().size();
          if (comp != 0) {
              return comp;
          }
          TreeSet<String> thisAttributes = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
          thisAttributes.addAll(getParameters().keySet());
          TreeSet<String> otherAttributes = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
          otherAttributes.addAll(other.getParameters().keySet());
          Iterator<String> thisAttributesIterator = thisAttributes.iterator();
          Iterator<String> otherAttributesIterator = otherAttributes.iterator();
          while (thisAttributesIterator.hasNext()) {
              String thisAttribute = thisAttributesIterator.next();
              String otherAttribute = otherAttributesIterator.next();
              comp = thisAttribute.compareToIgnoreCase(otherAttribute);
              if (comp != 0) {
                  return comp;
              }
              String thisValue = getParameters().get(thisAttribute);
              String otherValue = other.getParameters().get(otherAttribute);
              if (otherValue == null) {
                  otherValue = "";
              }
              comp = thisValue.compareTo(otherValue);
              if (comp != 0) {
                  return comp;
              }
          }
          return 0;
      }
docs: Compares this {@code MediaType} to another alphabetically.
  
  @param other media type to compare to.