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