@Test
public void testBasics() {

    assertEquals(
            "application/octet-stream",
            new MediaType("application", "octet-stream").toString());
    assertEquals(
            "text/plain",
            new MediaType("text", "plain").toString());
    Map<String, String> parameters = new HashMap<String, String>();
    assertEquals(
            "text/plain",
            new MediaType("text", "plain", parameters).toString());
    parameters.put("charset", "UTF-8");
    assertEquals(
            "text/plain; charset=UTF-8",
            new MediaType("text", "plain", parameters).toString());
    parameters.put("x-eol-style", "crlf");
    assertEquals(
            "text/plain; charset=UTF-8; x-eol-style=crlf",
            new MediaType("text", "plain", parameters).toString());
}