public static String prettyHex(byte[] data, int offset, int length) {
        if (length == 0) return "";

        final StringBuilder sb = new StringBuilder(length * 3 - 1);
        sb.append(String.format("%02X", data[offset]));
        for (int i = 1; i < length; i++) {
            sb.append(String.format(" %02X", data[offset + i]));
        }
        return sb.toString();
    }
@Test
    public void prettyHexEmptyByteArray() {
        assertEquals("", ByteArrayUtils.prettyHex(new byte[0]));
    }