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