@Test
public void testGetPreferredCharset() {

    final boolean ifUtf8Supported = StringUtils.isUtf8Supported();
    if (ifUtf8Supported) {
        assertEquals(StringUtils.getPreferredCharset(), Charset.forName("UTF-8"));
    } else {
        assertNotEquals(StringUtils.getPreferredCharset(), Charset.forName("UTF-8"));
    }
}