@Test
public void testToBoolean() {

  boolean exception = false;
  try {
    ByteAndBitConverter.toBoolean("Foo");
  } catch (IllegalArgumentException e) {
    exception = true;
  }
  Assert.assertTrue(exception);
  Boolean[] x = ByteAndBitConverter.toBoolean("00");
  Boolean[] expectedX = new Boolean[]{false, false, false, false, false, false, false, false};
  Assert.assertEquals(expectedX.length, x.length);
  Assert.assertArrayEquals(expectedX, x);
  Boolean[] y = ByteAndBitConverter.toBoolean("42");
  Boolean[] expectedY = new Boolean[]{false, true, false, false, false, false, true, false};
  Assert.assertEquals(expectedY.length, y.length);
  Assert.assertArrayEquals(expectedY, y);
  Boolean[] z = ByteAndBitConverter.toBoolean("42FF");
  Boolean[] expectedZ = new Boolean[]{false, true, false, false, false, false, true, false,
      true, true, true, true, true, true, true, true};
  Assert.assertEquals(expectedZ.length, z.length);
  Assert.assertArrayEquals(expectedZ, z);
}