### Question:
ProviderUtils { public static String getCharset(MediaType m) { return getCharset(m, null); }  static String getCharsetOrNull(MediaType m); static String getCharset(MediaType m); static String getCharset(MediaType m, HttpHeaders requestHeaders); static Reader createReader(InputStream stream, MediaType mediaType); static Writer createWriter(OutputStream stream, MediaType mediaType); static byte[] readFromStreamAsBytes(InputStream stream); static String readFromStreamAsString(InputStream stream, MediaType mt); static void writeToStream(String string, OutputStream os, MediaType mt); static void copyStream(InputStream src, OutputStream dst); static String writeToString(Providers providers, Object object, MediaType mediaType); static String writeToString(Providers providers,
                                       Object object,
                                       Class<?> type,
                                       MediaType mediaType); static String writeToString(Providers providers,
                                       Object object,
                                       Class<?> type,
                                       Type genericType,
                                       MediaType mediaType); @SuppressWarnings("unchecked") static String writeToString(Providers providers,
                                       Object object,
                                       Class<?> type,
                                       Type genericType,
                                       MultivaluedMap<String, Object> httpHeaders,
                                       MediaType mediaType); static T readFromString(Providers providers,
                                       String input,
                                       Class<T> type,
                                       MediaType mediaType); static T readFromString(Providers providers,
                                       String input,
                                       Class<T> type,
                                       Type genericType,
                                       MediaType mediaType); static T readFromString(Providers providers,
                                       String input,
                                       Class<T> type,
                                       Type genericType,
                                       MultivaluedMap<String, String> httpHeaders,
                                       MediaType mediaType); static void logUserProviderException(RuntimeException e,
            Object obj, // MessageBodyReader or MessageBodyWriter
            PROVIDER_EXCEPTION_ORIGINATOR originator,
            Object[] methodParams,
            RuntimeContext context);  }### Answer:
@Test public void testGetCharset() { MediaType mediaType = null; String charset = ProviderUtils.getCharset(mediaType); assertEquals(charset, "UTF-8"); mediaType = new MediaType("application", "atom+xml"); charset = ProviderUtils.getCharset(mediaType); assertEquals(charset, "UTF-8"); Map<String, String> parameters = new LinkedHashMap<String, String>(); parameters.put("charset", "UTF-16"); mediaType = new MediaType("application", "atom+xml", parameters); charset = ProviderUtils.getCharset(mediaType); assertEquals(charset, "UTF-16"); parameters = new LinkedHashMap<String, String>(); parameters.put("CharSet", "UTF-16"); mediaType = new MediaType("application", "atom+xml", parameters); charset = ProviderUtils.getCharset(mediaType); assertEquals(charset, "UTF-16"); }