StringSerializer { public static String decode(byte[] data) { return data == null ? null : new String(data, RpcConstants.DEFAULT_CHARSET); }  static byte[] encode(String s); static String decode(byte[] data);  }
@Test public void decode() { Assert.assertNull(StringSerializer.decode(null)); Assert.assertEquals("", StringSerializer.decode(new byte[0])); Assert.assertEquals("11", StringSerializer.decode(StringSerializer.encode("11"))); }