@Test
void testAcceptMimeTypes() {

    List<AcceptMIMEType> list = MimeTypes.parseAcceptMIMETypes("text/plain; q=0.9, text/html");
    assertEquals(2, list.size());
    assertEquals("text", list.get(0).getParentType());
    assertEquals("html", list.get(0).getChildType());
    assertEquals(1.0F, list.get(0).getQuality());
    assertEquals("text", list.get(1).getParentType());
    assertEquals("plain", list.get(1).getChildType());
    assertEquals(0.9F, list.get(1).getQuality());
    list = MimeTypes.parseAcceptMIMETypes("text/plain, text/html");
    assertEquals(2, list.size());
    assertEquals("text", list.get(0).getParentType());
    assertEquals("plain", list.get(0).getChildType());
    assertEquals("text", list.get(1).getParentType());
    assertEquals("html", list.get(1).getChildType());
    list = MimeTypes.parseAcceptMIMETypes("text/plain");
    assertEquals(1, list.size());
    assertEquals("text", list.get(0).getParentType());
    assertEquals("plain", list.get(0).getChildType());
    list = MimeTypes.parseAcceptMIMETypes("*/*; q=0.8, text/plain; q=0.9, text/html, */json");
    assertEquals(4, list.size());
    assertEquals("text", list.get(0).getParentType());
    assertEquals("html", list.get(0).getChildType());
    assertEquals(1.0F, list.get(0).getQuality());
    assertEquals(AcceptMIMEMatchType.EXACT, list.get(0).getMatchType());
    assertEquals("*", list.get(1).getParentType());
    assertEquals("json", list.get(1).getChildType());
    assertEquals(1.0F, list.get(1).getQuality());
    assertEquals(AcceptMIMEMatchType.CHILD, list.get(1).getMatchType());
    assertEquals("text", list.get(2).getParentType());
    assertEquals("plain", list.get(2).getChildType());
    assertEquals(0.9F, list.get(2).getQuality());
    assertEquals(AcceptMIMEMatchType.EXACT, list.get(2).getMatchType());
    assertEquals("*", list.get(3).getParentType());
    assertEquals("*", list.get(3).getChildType());
    assertEquals(0.8F, list.get(3).getQuality());
    assertEquals(AcceptMIMEMatchType.ALL, list.get(3).getMatchType());
}