### Question:
HttpHeaderHelper { public static String findCharset(String contentType) { if (contentType == null) { return null; } int idx = contentType.indexOf("charset="); if (idx != -1) { String charset = contentType.substring(idx + 8); if (charset.indexOf(';') != -1) { charset = charset.substring(0, charset.indexOf(';')).trim(); } if (charset.isEmpty()) { return null; } if (charset.charAt(0) == '\"') { charset = charset.substring(1, charset.length() - 1); } return charset; } return null; } private  HttpHeaderHelper(); static List<String> getHeader(Map<String, List<String>> headerMap, String key); static String getHeaderKey(final String key); static String findCharset(String contentType); static String mapCharset(String enc); static String mapCharset(String enc, String deflt); static final String ACCEPT_ENCODING; static final String CONTENT_TYPE; static final String CONTENT_ID; static final String CONTENT_ENCODING; static final String CONTENT_LENGTH; static final String CONTENT_TRANSFER_ENCODING; static final String COOKIE; static final String TRANSFER_ENCODING; static final String CHUNKED; static final String CONNECTION; static final String CLOSE; static final String AUTHORIZATION; }### Answer:
@Test public void testFindCharset() { final String charset = StandardCharsets.UTF_8.name(); String cs = HttpHeaderHelper.findCharset("foo/bar; charset=" + charset); assertEquals(charset, cs); }