BitCodec implements BlockCodec<Boolean> { @Override public Boolean decode(byte[] data, int bitLength) throws BlockCodecException { return (data[0] & 0x80) > 0; }  @Override Boolean zeroValue(); @Override Boolean decode(byte[] data, int bitLength); @Override byte[] encode(Boolean data, int bitLength); @Override void reset(); @Override String getValueType();  }
@Test public void testDecode() throws BlockCodecException { BitCodec codec = new BitCodec(); Assert.assertTrue(codec.decode(new byte[] { (byte) 0x88 }, 1)); Assert.assertFalse(codec.decode(new byte[] { (byte) 0x78 }, 1)); }