public static String readUtf8(final byte[] in) {
        if (in == null) {
            return null;
        }
        if (UnsafeUtil.hasUnsafe()) {
            return UnsafeUtf8Util.decodeUtf8(in, 0, in.length);
        } else {
            return new String(in, StandardCharsets.UTF_8);
        }
    }
@Test
    public void testReadUtf8() {
        Assert.assertNull(BytesUtil.readUtf8(null));

        Assert.assertEquals("foo", BytesUtil.readUtf8(new byte[] { 102, 111, 111 }));
    }