public static MediaType valueOf(String contentType) {
        if (StringUtils.isEmpty(contentType)) {
            throw new IllegalArgumentException("MediaType must not be empty");
        }
        String[] values = contentType.split(";");
        String charset = Constants.ENCODE;
        for (String value : values) {
            if (value.startsWith("charset=")) {
                charset = value.substring("charset=".length());
            }
        }
        return new MediaType(values[0], charset);
    }
@Test
    void testValueOf() {
        MediaType mediaType = MediaType.valueOf(MediaType.APPLICATION_FORM_URLENCODED);
        String type = "application/x-www-form-urlencoded";
        String charset = "UTF-8";
        assertEquals(type, mediaType.getType());
        assertEquals(charset, mediaType.getCharset());
        assertEquals(MediaType.APPLICATION_FORM_URLENCODED, mediaType.toString());
    }