FusekiBook implements OpeningBook { @Override public short nextMove(Board board) { final long fancyHash = board.getFancyHash(); if (board.getTurn() < maxMoves) { if (book.containsKey(fancyHash)) { final short move = book.get(fancyHash); if (board.isLegal(move)) { return move; } } } return CoordinateSystem.NO_POINT; } FusekiBook(); @SuppressWarnings("boxing")  FusekiBook(String directory); @Override short nextMove(Board board);  }
@Test public void testFusekiBook1() { String[] correct; correct = new String[] { "Q4", "D16", "C4" }; for (final String move : correct) { final short m = book.nextMove(board); assertEquals(move, coords.toString(m)); board.play(m); } board.play("h8"); assertEquals(NO_POINT, book.nextMove(board)); }