### Question:
AsciiHexInterpreter implements BinaryInterpreter { public byte[] uninterpret(byte[] rawData, int offset, int length) { byte[] d = new byte[length]; for (int i=0; i<length*2; i++) { int shift = i%2 == 1 ? 0 : 4; d[i>>1] |= Character.digit((char) rawData[offset+i], 16) << shift; } return d; }  void interpret(byte[] data, byte[] b, int offset); byte[] uninterpret(byte[] rawData, int offset, int length); int getPackedLength(int nBytes); static final AsciiHexInterpreter INSTANCE; }### Answer:
@Test public void testUninterpret() throws Exception { byte[] data = new byte[] {(byte)0xFF, (byte)0x12}; byte[] b = new byte[] {0x46, 0x46, 0x31, 0x32}; TestUtils.assertEquals(data, inter.uninterpret(b, 0, 2)); }
@Test public void testISOUtilCompatibility() throws Exception { byte[] b=ISOUtil.hex2byte("66656637656236643736323431653438"); AsciiHexInterpreter as=AsciiHexInterpreter.INSTANCE; byte[] n=as.uninterpret(b, 0, 8); byte[] a=ISOUtil.hex2byte("46454637454236443736323431453438"); byte[] n1=as.uninterpret(a, 0, 8); byte[] expected = ISOUtil.hex2byte("fef7eb6d76241e48"); assertEquals (ISOUtil.hexString(expected), ISOUtil.hexString(n)); assertEquals (ISOUtil.hexString(expected), ISOUtil.hexString(n1)); }