public static String toString(byte[] bytes, String charsetName) throws UnsupportedEncodingException {
        return charsetName == null ? new String(bytes) : new String(bytes, charsetName);
    }
@Test
    public void testToString() {
        Assert.assertEquals(null, StringUtils.toString(null));
        Assert.assertEquals("Bean:11", StringUtils.toString(new Bean("11")));

        Assert.assertEquals(null, StringUtils.toString((Object) null, null));
        Assert.assertEquals("1", StringUtils.toString((Object) null, "1"));
        Assert.assertEquals("Bean:11", StringUtils.toString(new Bean("11"), null));

        Assert.assertEquals(null, StringUtils.objectsToString(null));
        Assert.assertEquals("[]", StringUtils.objectsToString(new Object[0]));
        Assert.assertEquals("[1,22]", StringUtils.objectsToString(new Object[] { 1, "22" }));
        Assert.assertEquals("[1,Bean:11]", StringUtils.objectsToString(new Object[] { 1, new Bean("11") }));
    }