@Test
public void appendHexStringWithLong() throws Exception {

    StringBuilder s0 = new StringBuilder(16);
    HexUtil.appendHexString(s0, 0x65L);
    Assert.assertEquals("0000000000000065", s0.toString());
    s0.setLength(0);
    HexUtil.appendHexString(s0, 0x6534L);
    Assert.assertEquals("0000000000006534", s0.toString());
    s0.setLength(0);
    HexUtil.appendHexString(s0, 0x00L);
    Assert.assertEquals("0000000000000000", s0.toString());
    s0.setLength(0);
    // java is signed, so this should be a large hex representation
    HexUtil.appendHexString(s0, -34000L);
    Assert.assertEquals("FFFFFFFFFFFF7B30", s0.toString());
    s0.setLength(0);
    // java is signed, so this should be a large hex representation
    HexUtil.appendHexString(s0, -1L);
    Assert.assertEquals("FFFFFFFFFFFFFFFF", s0.toString());
}