### Question:
Raw implements Encoder { @Override public String encode(byte[] data) { return data != null ? new String(data, CHARSET) : null; }  byte[] decode(final String data); @Override String encode(byte[] data);  }### Answer:
@Test public void testEncode() throws Exception { String value = "hello"; assertEquals(value, encoder.encode(value.getBytes())); }
@Test public void testEncodeNullString() throws Exception { byte[] value = null; try { assertNull(encoder.encode(value)); } catch (Exception e) { fail("Should not raise any exception"); } }