BitBoard { static public final int numberOfTrailingZeros(long mask) { return trailingZ[(int)(((mask & -mask) * 0x07EDD5E59A4E28C2L) >>> 58)]; }  static long bishopAttacks(int sq, long occupied); static long rookAttacks(int sq, long occupied); static final int getDirection(int from, int to); static int getDistance(int from, int to); static long southFill(long mask); static long northFill(long mask); static final int numberOfTrailingZeros(long mask); static final long[] kingAttacks; static final long[] knightAttacks; static final long[] wPawnAttacks; static final long maskAToGFiles; static final long maskBToHFiles; static final long maskAToFFiles; static final long maskCToHFiles; static final long[] maskFile; static final long maskRow1; static final long maskRow2; static final long maskRow3; static final long maskRow4; static final long maskRow5; static final long maskRow6; static final long maskRow7; static final long maskRow8; static final long maskRow1Row8; static final long maskDarkSq; static final long maskLightSq; static final long maskCorners; static final long[][] squaresBetween; }
@Test public void testTrailingZeros() { System.out.println("trailingZeros"); for (int i = 0; i < 64; i++) { long mask = 1L << i; assertEquals(i, BitBoard.numberOfTrailingZeros(mask)); } }