public static int select(long w, int j) {
    int part1 = (int) (w & 0xFFFFFFFF);
    int wfirsthalf = Integer.bitCount(part1);
    if (wfirsthalf > j) {
      return select(part1, j);
    } else {
      return select((int) (w >>> 32), j - wfirsthalf) + 32;
    }
  }
public static int select ( long w , int j ) { int part1 = ( int ) ( w & 0xFFFFFFFF ) ; int wfirsthalf = Integer . bitCount ( part1 ) ; if ( wfirsthalf > j ) { return select ( part1 , j ) ; } else { return select ( ( int ) ( w > > > 32 ) , j - wfirsthalf ) + 32 ; } }
Given a word w, return the position of the jth true bit.

@param w word
@param j index
@return position of jth true bit in w