@Test
public void byte2Booleans() {

    Assert.assertEquals(0, CodecUtils.booleansToByte(null));
    Assert.assertEquals(0, CodecUtils.booleansToByte(new boolean[0]));
    // 01010101
    boolean[] bs = new boolean[] { false, true, false, true, false, true, false, true };
    byte b = CodecUtils.booleansToByte(bs);
    Assert.assertEquals(85, b);
    boolean[] bs2 = CodecUtils.byte2Booleans(b);
    for (int i = 0; i < bs.length; i++) {
        Assert.assertEquals(bs[i], bs2[i]);
    }
}