### Question:
MediaTypeHeaderProvider implements HeaderDelegate<MediaType> { public String toString(MediaType type) { return typeToString(type); }  MediaType fromString(String mType); static MediaType valueOf(String mType); static MediaType internalValueOf(String mType); String toString(MediaType type); static String typeToString(MediaType type); static String typeToString(MediaType type, List<String> ignoreParams);  }### Answer:
@Test public void testSimpleToString() { MediaTypeHeaderProvider provider = new MediaTypeHeaderProvider(); assertEquals("simple media type is not serialized", "text/plain", provider.toString(new MediaType("text", "plain"))); }
@Test public void testComplexToString() { MediaTypeHeaderProvider provider = new MediaTypeHeaderProvider(); Map<String, String> params = new LinkedHashMap<>(); params.put("foo", "bar"); params.put("q", "0.2"); assertEquals("complex media type is not serialized", "text/plain;foo=bar;q=0.2", provider.toString(new MediaType("text", "plain", params))); }