Just a suggestion to improve the insufficient material check. KBvKB with same coloured bishops is insufficient material, that is checked. But King versus King with any number of same coloured bishops on the board is also insufficient material, that could also be checked. I've seen that in the python chess API.
final Board board = new Board();
board.loadFromFen("B3k3/8/8/8/8/8/8/4KB2 w - - 0 1");
System.out.println(board.isInsufficientMaterial()); // false but actually true
final Board board = new Board();
board.loadFromFen("B1b1k3/3b4/4b3/8/8/8/8/4KB2 w - - 0 1");
System.out.println(board.isInsufficientMaterial()); // false but actually true
Just a suggestion to improve the insufficient material check. KBvKB with same coloured bishops is insufficient material, that is checked. But King versus King with any number of same coloured bishops on the board is also insufficient material, that could also be checked. I've seen that in the python chess API.
https://syzygy-tables.info/?fen=B3k3/8/8/8/8/8/8/4KB2_w_-_-_0_1
https://syzygy-tables.info/?fen=B1b1k3/3b4/4b3/8/8/8/8/4KB2_w_-_-_0_1