ZkUtils { static String string(byte[] bytes) { if (bytes == null) { return null; } try { return new String(bytes, UTF8); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("WTF-8", e); } } private  ZkUtils();   }
@Test public void testString() throws Exception { assertEquals(string(null), null); assertEquals(string(new byte[] {'a', 'b', 'c'}), "abc"); }