### Question:
Utils { static byte[] hexEncodeWithTerminatorByte(byte[] in) { if (in == null) { return null; } byte[] ret = new byte[(in.length << 1) + 1]; for (int i = 0; i < in.length; i++) { int v = in[i] & 0xff; ret[i << 1] = hexMap.get((char) encodingTable[v >>> 4]); ret[(i << 1) + 1] = hexMap.get((char) encodingTable[v & 0xf]); } ret[ret.length - 1] = TERMINATOR; return ret; }    }### Answer:
@Test public void testHexEncode_wTerminatorByte() { String value = "1234567890abcdef"; byte[] input = Hex.decode(value); byte[] expectOutput = new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 10, 11, 12, 13, 14, 15, 16}; byte[] rlpHexEncodeOutput = Utils.hexEncodeWithTerminatorByte(input); assertArrayEquals(rlpHexEncodeOutput, expectOutput); }