public static int countBitValue(int maxTurnCosts) {
        if (maxTurnCosts < 0)
            throw new IllegalArgumentException("maxTurnCosts cannot be negative " + maxTurnCosts);

        int counter = 0;
        while (maxTurnCosts > 0) {
            maxTurnCosts >>= 1;
            counter++;
        }
        return counter;
    }
@Test
    public void testCountBitValue() {
        assertEquals(1, BitUtil.countBitValue(1));
        assertEquals(2, BitUtil.countBitValue(2));
        assertEquals(2, BitUtil.countBitValue(3));
        assertEquals(3, BitUtil.countBitValue(4));
        assertEquals(3, BitUtil.countBitValue(7));
        assertEquals(4, BitUtil.countBitValue(8));
        assertEquals(5, BitUtil.countBitValue(20));
    }