@Test
public void testIntToBitSet() {

  BitSet x = ByteAndBitConverter.intToBitSet(5);
  BitSet expectedX = new BitSet(Integer.SIZE);
  expectedX.set(0);
  expectedX.set(2);
  Assert.assertEquals(expectedX, x);
  BitSet y = ByteAndBitConverter.intToBitSet(0);
  BitSet expectedY = new BitSet(Integer.SIZE);
  Assert.assertEquals(expectedY, y);
  BitSet z = ByteAndBitConverter.intToBitSet(-9);
  BitSet expectedZ = new BitSet(Integer.SIZE);
  expectedZ.set(3);
  expectedZ.flip(0, Integer.SIZE);
  Assert.assertEquals(expectedZ, z);
}