@Test
   void testBitsToInt() {

	BitSet bits = new BitSet();
	assertThat(Utils.bitsToInt(bits, 0, 8), is(equalTo(0)));
	bits.set(0, true);
	assertThat(Utils.bitsToInt(bits, 0, 1), is(equalTo(1)));
	assertThat(Utils.bitsToInt(bits, 0, 5), is(equalTo(1)));
	bits.set(1, true);
	assertThat(Utils.bitsToInt(bits, 0, 2), is(equalTo(3)));
	bits.set(2, true);
	assertThat(Utils.bitsToInt(bits, 0, 3), is(equalTo(7)));
	// Test just high bit set
	bits.set(0, 7, false);
	bits.set(7, true);
	assertThat(Utils.bitsToInt(bits, 0, 8), is(equalTo(128)));
	assertThat(Utils.bitsToInt(bits, 0, 7), is(equalTo(0)));
	assertThat(Utils.bitsToInt(bits, 5, 3), is(equalTo(4)));
}