### Question:
UriUtils { public static String getContentTypeWithoutCharset(String content) { String contentTypeWithoutCharset = content; String[] parts = StringUtils.split(content, ';'); if (parts.length >= 2) { StringBuilder contentTypeWithoutCharsetBuilder = new StringBuilder(parts.length); contentTypeWithoutCharsetBuilder.append(parts[0]); for (int i = 1; i < parts.length; i++) { String parameterAndValue = parts[i].trim().toLowerCase(); String[] splits = StringUtils.split(parameterAndValue, '='); if (splits.length > 0 && !splits[0].trim().equals(CHARSET)) { contentTypeWithoutCharsetBuilder.append(';').append(parts[i]); } } contentTypeWithoutCharset = contentTypeWithoutCharsetBuilder.toString(); } return contentTypeWithoutCharset; } private  UriUtils(); static boolean isValidHeaderName(String name); static boolean isValidHeaderValue(String val); static void copyResponseHeadersAndStatusCode(
      HttpResponse data, HttpResponseBuilder resp,
      boolean remapInternalServerError,
      boolean setHeaders,
      DisallowedHeaders... disallowedResponseHeaders); static void copyRequestHeaders(HttpRequest origRequest,
                                        HttpRequest req,
                                        DisallowedHeaders... disallowedRequestHeaders); static void copyRequestData(HttpRequest origRequest,
                                     HttpRequest req); static void maybeRewriteContentType(HttpRequest req, HttpResponseBuilder response); static String getContentTypeWithoutCharset(String content); static final String CHARSET; }### Answer:
@Test public void testGetContentTypeWithoutCharset() { assertEquals("text/html", UriUtils.getContentTypeWithoutCharset("text/html")); assertEquals("text/html;", UriUtils.getContentTypeWithoutCharset("text/html;")); assertEquals("text/html", UriUtils.getContentTypeWithoutCharset("text/html; charset=hello")); assertEquals("text/html; hello=world", UriUtils.getContentTypeWithoutCharset("text/html; charset=hello; hello=world")); assertEquals("text/html; pharset=hello; hello=world", UriUtils.getContentTypeWithoutCharset("text/html; pharset=hello; hello=world")); assertEquals("text/html; charsett=utf; hello=world", UriUtils.getContentTypeWithoutCharset("text/html; charsett=utf; ; hello=world")); }