@Test
public void toHexStringWithByteArray() throws Exception {

    String s0 = null;
    // a NULL byte array returns an empty string (safe choice)
    s0 = HexUtil.toHexString(null);
    Assert.assertEquals("", s0);
    s0 = HexUtil.toHexString(new byte[0]);
    Assert.assertEquals("", s0);
    s0 = HexUtil.toHexString(new byte[] { 0x34 });
    Assert.assertEquals("34", s0);
    s0 = HexUtil.toHexString(new byte[] { 0x34, 0x35 });
    Assert.assertEquals("3435", s0);
    s0 = HexUtil.toHexString(new byte[] { (byte)0xFF, (byte)0xAB });
    Assert.assertEquals("FFAB", s0);
}