### Question:
HexWritable extends BytesWritable { @Override public String toString() { final Hex hex = new Hex(); final byte[] bytes = new byte[getLength()]; System.arraycopy(getBytes(), 0, bytes, 0, bytes.length); return new String(hex.encode(bytes)); } HexWritable();  HexWritable(byte[] bytes); @Override String toString();  }### Answer:
@Test public void toStringTest() throws Exception { final Hex hex = new Hex(); final String str = "DEADBEEF"; final HexWritable hw = new HexWritable(hex.decode(str.getBytes())); assertEquals(str, hw.toString().toUpperCase()); }