@Test
public void appendHexStringWithInt() throws Exception {

    StringBuilder s0 = new StringBuilder(8);
    HexUtil.appendHexString(s0, (int)0x65);
    Assert.assertEquals("00000065", s0.toString());
    s0.setLength(0);
    HexUtil.appendHexString(s0, (int)0x6534);
    Assert.assertEquals("00006534", s0.toString());
    s0.setLength(0);
    HexUtil.appendHexString(s0, (int)0x00);
    Assert.assertEquals("00000000", s0.toString());
    s0.setLength(0);
    // java is signed, so this should be a large hex representation
    HexUtil.appendHexString(s0, -34000);
    Assert.assertEquals("FFFF7B30", s0.toString());
    s0.setLength(0);
    // java is signed, so this should be a large hex representation
    HexUtil.appendHexString(s0, -1);
    Assert.assertEquals("FFFFFFFF", s0.toString());
}