public static boolean getBooleanFromByte(byte modifiers, int i) {
        if (i > 7 || i < 0) {
            throw new IllegalArgumentException("Index must between 0-7!");
        }
        return ((modifiers >> i) & 0x01) == 1;
    }
@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);
    }