public final static int countNonzeroPairs(final long x){
  return Long.bitCount((x | x >>> 1) & 0x5555555555555555L);
}

public final static int countNonzeroPairs ( final long x ) { return Long . bitCount ( ( x | x > > > 1 ) & 0x5555555555555555L ) ; }
counts the number of nonzero pairs of bits in a long .
