add Long.toHexString and port unit-tests to use it