@Test
public void testDump() {

    byte[] bytes1 = new byte[]{17, 16, 17, 17, 17};
    byte[] bytes2 = new byte[]{1, 1, 1, 1, 1, 1, 1, 0, 1, 1};
    Assert.assertEquals("", Hex.dump(bytes1, 5, 0, 0, 1, 3));
    Assert.assertEquals("ba: 0101 00\nbd: 0101\n",
            Hex.dump(bytes2, 5, 5, 186, 3, 2));
    Assert.assertEquals("00: 10\n",
            Hex.dump(new byte[]{16}, 0, 1, 0, 1, 2));
    Assert.assertEquals("00000000: 10\n",
            Hex.dump(new byte[]{16}, 0, 1, 0, 0, 3));
    Assert.assertEquals("0000: 10\n",
            Hex.dump(new byte[]{16}, 0, 1, 0, 0, 4));
    Assert.assertEquals("000000: 10\n",
            Hex.dump(new byte[]{16}, 0, 1, 0, 1, 6));
}