assertTrue(Arrays.equals(data, data2));
String dataString = new String(encodedChars); char[] encodedStringChars = (char[])hex.encode(dataString); decodedBytes = (byte[])hex.decode(encodedStringChars); assertTrue(Arrays.equals(dataString.getBytes(), decodedBytes));   dataString = new String(encodedChars); encodedStringChars = (char[])hex.encode(dataString); decodedBytes = (byte[])hex.decode(new String(encodedStringChars)); assertTrue(Arrays.equals(dataString.getBytes(), decodedBytes));
    public void testEncodeDecodeRandom() throws Exception {        Random random = new Random();        for (int i = 5; i > 0; i--) {            byte[] data = new byte[random.nextInt(10000) + 1];            random.nextBytes(data);            char[] enc = Hex.encodeHex(data);            byte[] data2 = Hex.decodeHex(enc);            assertTrue(Arrays.equals(data, data2));        }    }