class MediaType {

  @Override
  public String toString() {
    String str = type + "/" + subtype;
    if (!parameters.isEmpty()) {
      String joinedParameters =
          parameters.entrySet().stream()
              .map(e -> e.getKey() + "=" + escapeAndQuoteValue(e.getValue()))
              .collect(Collectors.joining("; "));
      str += "; " + joinedParameters;
    }
    return str;
  }

  private  MediaType(String type, String subtype);
  private  MediaType(String type, String subtype, Map<String, String> parameters);

}