public static String baToHexString(byte[] ba) {
        StringBuilder sb = new StringBuilder(ba.length * 2);
        for (byte b : ba) {
            int j = b & 0xff;
            if (j < 16) {
                sb.append('0'); // $NON-NLS-1$ add zero padding
            }
            sb.append(Integer.toHexString(j));
        }
        return sb.toString();
    }
@Test
    public void testbaToHexString() {
        assertEquals("", JOrphanUtils.baToHexString(new byte[]{}));
        assertEquals("00", JOrphanUtils.baToHexString(new byte[]{0}));
        assertEquals("0f107f8081ff", JOrphanUtils.baToHexString(new byte[]{15, 16, 127, -128, -127, -1}));
    }