@Test
public void normalizeLeadingHexZeroes() throws Exception {

    // appending digits or equal
    Assert.assertEquals("00", NumberRadixUtil.normalizeLeadingHexZeroes("0", 2));
    Assert.assertEquals("00", NumberRadixUtil.normalizeLeadingHexZeroes("00", 2));
    Assert.assertEquals("0F", NumberRadixUtil.normalizeLeadingHexZeroes("F", 2));
    Assert.assertEquals("FF", NumberRadixUtil.normalizeLeadingHexZeroes("FF", 2));
    Assert.assertEquals("0000", NumberRadixUtil.normalizeLeadingHexZeroes("0", 4));
    Assert.assertEquals("0000", NumberRadixUtil.normalizeLeadingHexZeroes("00", 4));
    Assert.assertEquals("000F", NumberRadixUtil.normalizeLeadingHexZeroes("F", 4));
    Assert.assertEquals("00FF", NumberRadixUtil.normalizeLeadingHexZeroes("FF", 4));
    Assert.assertEquals("0FFF", NumberRadixUtil.normalizeLeadingHexZeroes("FFF", 4));
    Assert.assertEquals("FFFF", NumberRadixUtil.normalizeLeadingHexZeroes("FFFF", 4));
    Assert.assertEquals("00000000", NumberRadixUtil.normalizeLeadingHexZeroes("0", 8));
    Assert.assertEquals("00000000", NumberRadixUtil.normalizeLeadingHexZeroes("00", 8));
    Assert.assertEquals("0000000F", NumberRadixUtil.normalizeLeadingHexZeroes("F", 8));
    Assert.assertEquals("000000FF", NumberRadixUtil.normalizeLeadingHexZeroes("FF", 8));
    Assert.assertEquals("00000FFF", NumberRadixUtil.normalizeLeadingHexZeroes("FFF", 8));
    Assert.assertEquals("0000FFFF", NumberRadixUtil.normalizeLeadingHexZeroes("FFFF", 8));
    Assert.assertEquals("FFFFFFFF", NumberRadixUtil.normalizeLeadingHexZeroes("FFFFFFFF", 8));
    // trimming digits
    Assert.assertEquals("00", NumberRadixUtil.normalizeLeadingHexZeroes("000", 2));
    Assert.assertEquals("00", NumberRadixUtil.normalizeLeadingHexZeroes("0000", 2));
    Assert.assertEquals("0F", NumberRadixUtil.normalizeLeadingHexZeroes("00F", 2));
    Assert.assertEquals("FF", NumberRadixUtil.normalizeLeadingHexZeroes("000000000FF", 2));
}