class BitUtils {

    static int countOf1InBinary(long n) {
        int count = 0;
        while (n > 0) {
            count = n % 2 > 0 ? count + 1 : count;
            n = n >> 1;
        }
        return count;
    }

}