@Test
public void appendHexStringWithShort() throws Exception {

    StringBuilder s0 = new StringBuilder(4);
    HexUtil.appendHexString(s0, (short)0x65);
    Assert.assertEquals("0065", s0.toString());
    s0.setLength(0);
    HexUtil.appendHexString(s0, (short)0x6534);
    Assert.assertEquals("6534", s0.toString());
    s0.setLength(0);
    HexUtil.appendHexString(s0, (short)0x00);
    Assert.assertEquals("0000", s0.toString());
    s0.setLength(0);
    // java is signed, so this should be a large hex representation
    HexUtil.appendHexString(s0, (short)-1);
    Assert.assertEquals("FFFF", s0.toString());
}