public static int parseHexToInt(String hex) {
        return parseHexToInt(hex, true);
    }
@Test
    public void parseHexToInt() {
        Assertions.assertEquals(0xAB, TbUtils.parseHexToInt("AB"));

        Assertions.assertEquals(0xABBA, TbUtils.parseHexToInt("ABBA", true));
        Assertions.assertEquals(0xBAAB, TbUtils.parseHexToInt("ABBA", false));
        Assertions.assertEquals(0xAABBCC, TbUtils.parseHexToInt("AABBCC", true));
        Assertions.assertEquals(0xAABBCC, TbUtils.parseHexToInt("CCBBAA", false));
        Assertions.assertThrows(NumberFormatException.class, () -> TbUtils.parseHexToInt("AABBCCDD", true));
        Assertions.assertEquals(0x11BBCC22, TbUtils.parseHexToInt("11BBCC22", true));
        Assertions.assertEquals(0x11BBCC22, TbUtils.parseHexToInt("22CCBB11", false));
    }