@Test
public void getBooleanFromByte() {

    byte b = 0x35; // 0011 0101
    Assert.assertTrue(CodecUtils.getBooleanFromByte(b, 0));
    Assert.assertFalse(CodecUtils.getBooleanFromByte(b, 1));
    Assert.assertTrue(CodecUtils.getBooleanFromByte(b, 2));
    Assert.assertFalse(CodecUtils.getBooleanFromByte(b, 3));
    Assert.assertTrue(CodecUtils.getBooleanFromByte(b, 4));
    Assert.assertTrue(CodecUtils.getBooleanFromByte(b, 5));
    Assert.assertFalse(CodecUtils.getBooleanFromByte(b, 6));
    Assert.assertFalse(CodecUtils.getBooleanFromByte(b, 7));
    boolean ok = true;
    try {
        Assert.assertFalse(CodecUtils.getBooleanFromByte(b, -1));
    } catch (Exception e) {
        ok = false;
    }
    Assert.assertFalse(ok);
    ok = true;
    try {
        Assert.assertFalse(CodecUtils.getBooleanFromByte(b, 8));
    } catch (Exception e) {
        ok = false;
    }
    Assert.assertFalse(ok);
}