ContentType type; type = new ContentType("text/plain"); assertEquals("text", type.getPrimaryType()); assertEquals("plain", type.getSubType()); assertEquals(null, type.getParameterList()); type = new ContentType("image/audio;charset=us-ascii"); ParameterList parameterList = type.getParameterList(); assertEquals("image", type.getPrimaryType()); assertEquals("audio", type.getSubType()); assertEquals("us-ascii", parameterList.get("charset"));
ContentType type = new ContentType(); assertNull(type.getPrimaryType()); assertNull(type.getSubType()); assertNull(type.getParameter("charset"));
    public void testContentType() throws ParseException {        ContentType type;        type = new ContentType("text/plain");        assertEquals("text", type.getPrimaryType());        assertEquals("plain", type.getSubType());        assertEquals(null, type.getParameterList());        type = new ContentType("image/audio;charset=us-ascii");        ParameterList parameterList = type.getParameterList();        assertEquals("image", type.getPrimaryType());        assertEquals("audio", type.getSubType());        assertEquals("us-ascii", parameterList.get("charset"));    }