@Test
public void hexToDualLong() {

    String traceIdOrig;
    String traceIdResult;
    Random rand = new Random();
    BigInteger traceIdNum;
    //Testing process random long long large than 120 bits
    for (int i = 0; i < 10; i++) {
        traceIdNum = new BigInteger(125, 100, rand);
        traceIdOrig = traceIdNum.toString(16);
        long[] ids = CommonUtils.hexToDualLong(traceIdOrig);
        traceIdResult = String.format("%x%016x", ids[0], ids[1]);//.replaceFirst("^0+(?!$)", "");
        assertEquals(traceIdOrig, traceIdResult);
    }
    //Testing process sofa generated traceId
    for (int i = 0; i < 10; i++) {
        traceIdOrig = TraceIdGenerator.generate();
        long[] ids = CommonUtils.hexToDualLong(traceIdOrig);
        // avoid hexadecimal high bit lost 0
        traceIdResult = String.format("%x%016x", ids[0], ids[1]);//.replaceFirst("^0+(?!$)", "");
        int diffLen = traceIdOrig.length() - traceIdResult.length();
        while (diffLen-- > 0) {
            traceIdResult = "0" + traceIdResult;
        }
        assertEquals(traceIdOrig, traceIdResult);
    }
}