@Test
public void testEncode() throws BlockCodecException {

    BooleanCodec codec = new BooleanCodec();
    Assert.assertEquals((byte) 0x80, codec.encode(true, 1)[0]);
    Assert.assertEquals((byte) 0x40, codec.encode(true, 2)[0]);
    Assert.assertEquals((byte) 0x20, codec.encode(true, 3)[0]);
    Assert.assertEquals((byte) 0x10, codec.encode(true, 4)[0]);
    Assert.assertEquals((byte) 0x08, codec.encode(true, 5)[0]);
    Assert.assertEquals((byte) 0x04, codec.encode(true, 6)[0]);
    Assert.assertEquals((byte) 0x02, codec.encode(true, 7)[0]);
    Assert.assertEquals((byte) 0x01, codec.encode(true, 8)[0]);
}