ByteUtil { public static String toHexString(byte[] bytes) { char[] chars = new char[bytes.length * 2]; int i = 0; for (byte b : bytes) { chars[i++] = HEX_CHARS[b >> 4 & 0xF]; chars[i++] = HEX_CHARS[b & 0xF]; } return new String(chars); }  static byte int3(final int x); static byte int2(final int x); static byte int1(final int x); static byte int0(final int x); static String toHexString(byte[] bytes);  }
@Test public void testToHexString() { Assert.assertEquals("", ByteUtil.toHexString(new byte[] {})); Assert.assertEquals("98", ByteUtil.toHexString(new byte[] {(byte)-104})); }