### Question:
Charsets { public static Charset toCharset(final Charset charset) { return charset == null ? Charset.defaultCharset() : charset; }  static Charset toCharset(final Charset charset); static Charset toCharset(final String charset); @Deprecated
    static final Charset ISO_8859_1; @Deprecated
    static final Charset US_ASCII; @Deprecated
    static final Charset UTF_16; @Deprecated
    static final Charset UTF_16BE; @Deprecated
    static final Charset UTF_16LE; @Deprecated
    static final Charset UTF_8; }### Answer:
@Test public void testToCharset() { Assert.assertEquals(Charset.defaultCharset(), Charsets.toCharset((String) null)); Assert.assertEquals(Charset.defaultCharset(), Charsets.toCharset((Charset) null)); Assert.assertEquals(Charset.defaultCharset(), Charsets.toCharset(Charset.defaultCharset())); Assert.assertEquals(Charset.forName("UTF-8"), Charsets.toCharset(Charset.forName("UTF-8"))); }