public static int countNumberOfBitsLogN(int x) {
        int result = 0;
        while (x != 0) {
            x &= (x - 1);
            result++;
        }
        return result;
    }
Brian Kernighan's method goes through as many iterations as there are set bits.
So if we have a 32-bit word with only the high bit set,
then it will only go once through the loop.

@param x
@return
src/main/java/com/github/pedrovgs/problem1/BitsCounter.java