public static int ntz2(long x) {
    int n = 0;
    int y = (int) x;
    if (y == 0) {
      n += 32;
      y = (int) (x >>> 32);
    }   // the only 64 bit shift necessary
    if ((y & 0x0000FFFF) == 0) {
      n += 16;
      y >>>= 16;
    }
    if ((y & 0x000000FF) == 0) {
      n += 8;
      y >>>= 8;
    }
    return (ntzTable[y & 0xff]) + n;
  }
returns 0 based index of first set bit
(only works for x!=0)
<br/> This is an alternate implementation of ntz()
ambry-utils/src/main/java/com/github/ambry/utils/BitUtil.java