### Question:
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); String type(); String subtype(); Map<String, String> parameters(); Optional<Charset> charset(); Charset charsetOrDefault(Charset defaultCharset); boolean hasWildcard(); boolean includes(MediaType other); boolean isCompatibleWith(MediaType other); MediaType withCharset(Charset charset); MediaType withParameter(String name, String value); MediaType withParameters(Map<String, String> parameters); @Override boolean equals(@Nullable Object obj); @Override int hashCode(); @Override String toString(); static MediaType of(String type, String subtype); static MediaType of(String type, String subtype, Map<String, String> parameters); static MediaType parse(String value); static final MediaType ANY; static final MediaType APPLICATION_ANY; static final MediaType IMAGE_ANY; static final MediaType TEXT_ANY; static final MediaType APPLICATION_FORM_URLENCODED; static final MediaType APPLICATION_JSON; static final MediaType APPLICATION_OCTET_STREAM; static final MediaType APPLICATION_XHTML_XML; static final MediaType APPLICATION_XML; static final MediaType APPLICATION_X_PROTOBUF; static final MediaType IMAGE_GIF; static final MediaType IMAGE_JPEG; static final MediaType IMAGE_PNG; static final MediaType TEXT_HTML; static final MediaType TEXT_MARKDOWN; static final MediaType TEXT_PLAIN; static final MediaType TEXT_XML; }### Answer:
@Test void constantsSanityTest() { assertEquals("*/*", MediaType.ANY.toString()); assertEquals("application/*", MediaType.APPLICATION_ANY.toString()); assertEquals("image/*", MediaType.IMAGE_ANY.toString()); assertEquals("text/*", MediaType.TEXT_ANY.toString()); assertEquals( "application/x-www-form-urlencoded", MediaType.APPLICATION_FORM_URLENCODED.toString()); assertEquals("application/json", MediaType.APPLICATION_JSON.toString()); assertEquals("application/octet-stream", MediaType.APPLICATION_OCTET_STREAM.toString()); assertEquals("application/xhtml+xml", MediaType.APPLICATION_XHTML_XML.toString()); assertEquals("application/xml", MediaType.APPLICATION_XML.toString()); assertEquals("application/x-protobuf", MediaType.APPLICATION_X_PROTOBUF.toString()); assertEquals("image/gif", MediaType.IMAGE_GIF.toString()); assertEquals("image/jpeg", MediaType.IMAGE_JPEG.toString()); assertEquals("image/png", MediaType.IMAGE_PNG.toString()); assertEquals("text/html", MediaType.TEXT_HTML.toString()); assertEquals("text/markdown", MediaType.TEXT_MARKDOWN.toString()); assertEquals("text/plain", MediaType.TEXT_PLAIN.toString()); assertEquals("text/xml", MediaType.TEXT_XML.toString()); }