content: package com.chess.tests;
  
  import com.chess.engine.board.Board;
  import com.chess.engine.board.BoardUtils;
  import com.chess.engine.board.Move;
  import com.chess.engine.board.MoveTransition;
  import com.chess.engine.pieces.Piece;
  import com.chess.pgn.FenUtilities;
  import org.junit.Assert;
  import org.junit.Test;
  
  import java.util.Collection;
  import java.util.HashSet;
  import java.util.Set;
  
  import static junit.framework.Assert.assertEquals;
  import static junit.framework.Assert.assertTrue;
  import static org.junit.Assert.assertNotNull;
  
  public class TestPieces {
  
      @Test
      public void testMiddleQueenOnEmptyBoard() {
          final Board board = FenUtilities.createGameFromFEN("4k3/8/8/8/4Q3/8/8/4K3 w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
          final Collection<Move> whiteLegals = board.whitePlayer().getLegalMoves();
          final Collection<Move> blackLegals = board.blackPlayer().getLegalMoves();
          assertEquals(31, whiteLegals.size());
          assertEquals(5, blackLegals.size());
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e8"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e7"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e6"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e5"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e3"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e2"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("a4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("b4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("c4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("d4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("f4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("g4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("h4"))));
      }
  
      @Test
      public void testPromotionScenario() {
          final Board board = FenUtilities.createGameFromFEN("r1bq1Bk1/pp2pp1p/2n3p1/2pn4/5P2/NP2PN2/P1PPp1PP/3RQRK1 b - - 0 1");
          System.out.println(board);
  
      }
  
      @Test
      public void testLegalMoveAllAvailable() {
          final Board board = FenUtilities.createGameFromFEN("4k3/8/8/4n3/4N3/8/8/4K3 w - - 0 1\n");
          final Collection<Move> whiteLegals = board.whitePlayer().getLegalMoves();
          assertEquals(13, whiteLegals.size());
          final Move wm1 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("d6"));
          final Move wm2 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("f6"));
          final Move wm3 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("c5"));
          final Move wm4 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("g5"));
          final Move wm5 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("c3"));
          final Move wm6 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("g3"));
          final Move wm7 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("d2"));
          final Move wm8 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("f2"));
  
          assertTrue(whiteLegals.contains(wm1));
          assertTrue(whiteLegals.contains(wm2));
          assertTrue(whiteLegals.contains(wm3));
          assertTrue(whiteLegals.contains(wm4));
          assertTrue(whiteLegals.contains(wm5));
          assertTrue(whiteLegals.contains(wm6));
          assertTrue(whiteLegals.contains(wm7));
          assertTrue(whiteLegals.contains(wm8));
  
          final Board board2 = FenUtilities.createGameFromFEN("4k3/8/8/4n3/4N3/8/8/4K3 b - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board2));
          final Collection<Move> blackLegals = board.blackPlayer().getLegalMoves();
  
          final Move bm1 = Move.MoveFactory
                  .createMove(board2, BoardUtils.INSTANCE.getCoordinateAtPosition("e5"), BoardUtils.INSTANCE.getCoordinateAtPosition("d7"));
          final Move bm2 = Move.MoveFactory
                  .createMove(board2, BoardUtils.INSTANCE.getCoordinateAtPosition("e5"), BoardUtils.INSTANCE.getCoordinateAtPosition("f7"));
          final Move bm3 = Move.MoveFactory
                  .createMove(board2, BoardUtils.INSTANCE.getCoordinateAtPosition("e5"), BoardUtils.INSTANCE.getCoordinateAtPosition("c6"));
          final Move bm4 = Move.MoveFactory
                  .createMove(board2, BoardUtils.INSTANCE.getCoordinateAtPosition("e5"), BoardUtils.INSTANCE.getCoordinateAtPosition("g6"));
          final Move bm5 = Move.MoveFactory
                  .createMove(board2, BoardUtils.INSTANCE.getCoordinateAtPosition("e5"), BoardUtils.INSTANCE.getCoordinateAtPosition("c4"));
          final Move bm6 = Move.MoveFactory
                  .createMove(board2, BoardUtils.INSTANCE.getCoordinateAtPosition("e5"), BoardUtils.INSTANCE.getCoordinateAtPosition("g4"));
          final Move bm7 = Move.MoveFactory
                  .createMove(board2, BoardUtils.INSTANCE.getCoordinateAtPosition("e5"), BoardUtils.INSTANCE.getCoordinateAtPosition("d3"));
          final Move bm8 = Move.MoveFactory
                  .createMove(board2, BoardUtils.INSTANCE.getCoordinateAtPosition("e5"), BoardUtils.INSTANCE.getCoordinateAtPosition("f3"));
  
          assertEquals(13, blackLegals.size());
  
          assertTrue(blackLegals.contains(bm1));
          assertTrue(blackLegals.contains(bm2));
          assertTrue(blackLegals.contains(bm3));
          assertTrue(blackLegals.contains(bm4));
          assertTrue(blackLegals.contains(bm5));
          assertTrue(blackLegals.contains(bm6));
          assertTrue(blackLegals.contains(bm7));
          assertTrue(blackLegals.contains(bm8));
      }
  
      @Test
      public void testKnightInCorners() {
          final Board board = FenUtilities.createGameFromFEN("n3k3/8/8/8/8/8/8/N3K3 w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
          final Collection<Move> whiteLegals = board.whitePlayer().getLegalMoves();
          final Collection<Move> blackLegals = board.blackPlayer().getLegalMoves();
          assertEquals(7, whiteLegals.size());
          assertEquals(7, blackLegals.size());
          final Move wm1 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a1"), BoardUtils.INSTANCE.getCoordinateAtPosition("b3"));
          final Move wm2 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a1"), BoardUtils.INSTANCE.getCoordinateAtPosition("c2"));
          assertTrue(whiteLegals.contains(wm1));
          assertTrue(whiteLegals.contains(wm2));
          final Move bm1 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a8"), BoardUtils.INSTANCE.getCoordinateAtPosition("b6"));
          final Move bm2 = Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a8"), BoardUtils.INSTANCE.getCoordinateAtPosition("c7"));
          assertTrue(blackLegals.contains(bm1));
          assertTrue(blackLegals.contains(bm2));
  
      }
  
      @Test
      public void testMiddleBishopOnEmptyBoard() {
          final Board board = FenUtilities.createGameFromFEN("4k3/8/8/8/3B4/8/8/4K3 w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
          final Collection<Move> whiteLegals = board.whitePlayer().getLegalMoves();
          final Collection<Move> blackLegals = board.blackPlayer().getLegalMoves();
          assertEquals(18, whiteLegals.size());
          assertEquals(5, blackLegals.size());
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("d4"), BoardUtils.INSTANCE.getCoordinateAtPosition("a7"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("d4"), BoardUtils.INSTANCE.getCoordinateAtPosition("b6"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("d4"), BoardUtils.INSTANCE.getCoordinateAtPosition("c5"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("d4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e3"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("d4"), BoardUtils.INSTANCE.getCoordinateAtPosition("f2"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("d4"), BoardUtils.INSTANCE.getCoordinateAtPosition("g1"))));
      }
  
      @Test
      public void testTopLeftBishopOnEmptyBoard() {
          final Board board = FenUtilities.createGameFromFEN("B3k3/8/8/8/8/8/8/4K3 w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
          final Collection<Move> whiteLegals = board.whitePlayer().getLegalMoves();
          final Collection<Move> blackLegals = board.blackPlayer().getLegalMoves();
          assertEquals(board.getPiece(0), board.getPiece(0));
          assertNotNull(board.getPiece(0));
          assertEquals(12, whiteLegals.size());
          assertEquals(5, blackLegals.size());
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a8"), BoardUtils.INSTANCE.getCoordinateAtPosition("b7"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a8"), BoardUtils.INSTANCE.getCoordinateAtPosition("c6"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a8"), BoardUtils.INSTANCE.getCoordinateAtPosition("d5"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a8"), BoardUtils.INSTANCE.getCoordinateAtPosition("e4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a8"), BoardUtils.INSTANCE.getCoordinateAtPosition("f3"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a8"), BoardUtils.INSTANCE.getCoordinateAtPosition("g2"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a8"), BoardUtils.INSTANCE.getCoordinateAtPosition("h1"))));
      }
  
      @Test
      public void testTopRightBishopOnEmptyBoard() {
          final Board board = FenUtilities.createGameFromFEN("4k2B/8/8/8/8/8/8/4K3 w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
          final Collection<Move> whiteLegals = board.whitePlayer().getLegalMoves();
          final Collection<Move> blackLegals = board.blackPlayer().getLegalMoves();
          assertEquals(12, whiteLegals.size());
          assertEquals(5, blackLegals.size());
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h8"), BoardUtils.INSTANCE.getCoordinateAtPosition("g7"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h8"), BoardUtils.INSTANCE.getCoordinateAtPosition("f6"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h8"), BoardUtils.INSTANCE.getCoordinateAtPosition("e5"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h8"), BoardUtils.INSTANCE.getCoordinateAtPosition("d4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h8"), BoardUtils.INSTANCE.getCoordinateAtPosition("c3"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h8"), BoardUtils.INSTANCE.getCoordinateAtPosition("b2"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h8"), BoardUtils.INSTANCE.getCoordinateAtPosition("a1"))));
      }
  
      @Test
      public void testBottomLeftBishopOnEmptyBoard() {
          final Board board = FenUtilities.createGameFromFEN("4k3/8/8/8/8/8/8/B3K3 w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
          final Collection<Move> whiteLegals = board.whitePlayer().getLegalMoves();
          final Collection<Move> blackLegals = board.blackPlayer().getLegalMoves();
          assertEquals(12, whiteLegals.size());
          assertEquals(5, blackLegals.size());
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a1"), BoardUtils.INSTANCE.getCoordinateAtPosition("b2"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a1"), BoardUtils.INSTANCE.getCoordinateAtPosition("c3"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a1"), BoardUtils.INSTANCE.getCoordinateAtPosition("d4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a1"), BoardUtils.INSTANCE.getCoordinateAtPosition("e5"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a1"), BoardUtils.INSTANCE.getCoordinateAtPosition("f6"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a1"), BoardUtils.INSTANCE.getCoordinateAtPosition("g7"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("a1"), BoardUtils.INSTANCE.getCoordinateAtPosition("h8"))));
      }
  
      @Test
      public void testBottomRightBishopOnEmptyBoard() {
          final Board board = FenUtilities.createGameFromFEN("4k3/8/8/8/8/8/8/4K2B w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
          final Collection<Move> whiteLegals = board.whitePlayer().getLegalMoves();
          final Collection<Move> blackLegals = board.blackPlayer().getLegalMoves();
          assertEquals(12, whiteLegals.size());
          assertEquals(5, blackLegals.size());
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h1"), BoardUtils.INSTANCE.getCoordinateAtPosition("g2"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h1"), BoardUtils.INSTANCE.getCoordinateAtPosition("f3"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h1"), BoardUtils.INSTANCE.getCoordinateAtPosition("e4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h1"), BoardUtils.INSTANCE.getCoordinateAtPosition("d5"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h1"), BoardUtils.INSTANCE.getCoordinateAtPosition("c6"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h1"), BoardUtils.INSTANCE.getCoordinateAtPosition("b7"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("h1"), BoardUtils.INSTANCE.getCoordinateAtPosition("a8"))));
      }
  
      @Test
      public void testMiddleRookOnEmptyBoard() {
          final Board board = FenUtilities.createGameFromFEN("4k3/8/8/8/4R3/8/8/4K3 w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
  
          final Collection<Move> whiteLegals = board.whitePlayer().getLegalMoves();
          final Collection<Move> blackLegals = board.blackPlayer().getLegalMoves();
          assertEquals(18, whiteLegals.size());
          assertEquals(5, blackLegals.size());
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e8"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e7"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e6"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e5"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e3"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e2"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("a4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("b4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("c4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("d4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("f4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("g4"))));
          assertTrue(whiteLegals.contains(Move.MoveFactory
                  .createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("h4"))));
      }
  
      @Test
      public void testPawnPromotion() {
          final Board board = FenUtilities.createGameFromFEN("3r4/7P/6k1/8/8/8/4K3/8 w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
          final Move m1 = Move.MoveFactory.createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition(
                  "h7"), BoardUtils.INSTANCE.getCoordinateAtPosition("h8"));
          final MoveTransition t1 = board.currentPlayer().makeMove(m1);
          Assert.assertTrue(t1.getMoveStatus().isDone());
          final Move m2 = Move.MoveFactory.createMove(t1.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("d8"), BoardUtils.INSTANCE.getCoordinateAtPosition("h8"));
          final MoveTransition t2 = t1.getToBoard().currentPlayer().makeMove(m2);
          Assert.assertTrue(t2.getMoveStatus().isDone());
          final Move m3 = Move.MoveFactory.createMove(t2.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("e2"), BoardUtils.INSTANCE.getCoordinateAtPosition("d2"));
          final MoveTransition t3 = board.currentPlayer().makeMove(m3);
          Assert.assertTrue(t3.getMoveStatus().isDone());
      }
  
      @Test
      public void testSimpleWhiteEnPassant() {
          final Board board = FenUtilities.createGameFromFEN("4k3/3p4/8/8/8/8/4P3/4K3 w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
          final Move m1 = Move.MoveFactory.createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition(
                  "e2"), BoardUtils.INSTANCE.getCoordinateAtPosition("e4"));
          final MoveTransition t1 = board.currentPlayer().makeMove(m1);
          Assert.assertTrue(t1.getMoveStatus().isDone());
          final Move m2 = Move.MoveFactory.createMove(t1.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("e8"), BoardUtils.INSTANCE.getCoordinateAtPosition("d8"));
          final MoveTransition t2 = t1.getToBoard().currentPlayer().makeMove(m2);
          Assert.assertTrue(t2.getMoveStatus().isDone());
          final Move m3 = Move.MoveFactory.createMove(t2.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("e4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e5"));
          final MoveTransition t3 = t2.getToBoard().currentPlayer().makeMove(m3);
          Assert.assertTrue(t3.getMoveStatus().isDone());
          final Move m4 = Move.MoveFactory.createMove(t3.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("d7"), BoardUtils.INSTANCE.getCoordinateAtPosition("d5"));
          final MoveTransition t4 = t3.getToBoard().currentPlayer().makeMove(m4);
          Assert.assertTrue(t4.getMoveStatus().isDone());
          final Move m5 = Move.MoveFactory.createMove(t4.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("e5"), BoardUtils.INSTANCE.getCoordinateAtPosition("d6"));
          final MoveTransition t5 = t4.getToBoard().currentPlayer().makeMove(m5);
          Assert.assertTrue(t5.getMoveStatus().isDone());
      }
  
      @Test
      public void testSimpleBlackEnPassant() {
          final Board board = FenUtilities.createGameFromFEN("4k3/3p4/8/8/8/8/4P3/4K3 w - - 0 1");
          System.out.println(FenUtilities.createFENFromGame(board));
          final Move m1 = Move.MoveFactory.createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition(
                  "e1"), BoardUtils.INSTANCE.getCoordinateAtPosition("d1"));
          final MoveTransition t1 = board.currentPlayer().makeMove(m1);
          assertTrue(t1.getMoveStatus().isDone());
          final Move m2 = Move.MoveFactory.createMove(t1.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("d7"), BoardUtils.INSTANCE.getCoordinateAtPosition("d5"));
          final MoveTransition t2 = t1.getToBoard().currentPlayer().makeMove(m2);
          assertTrue(t2.getMoveStatus().isDone());
          final Move m3 = Move.MoveFactory.createMove(t2.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("d1"), BoardUtils.INSTANCE.getCoordinateAtPosition("c1"));
          final MoveTransition t3 = t2.getToBoard().currentPlayer().makeMove(m3);
          assertTrue(t3.getMoveStatus().isDone());
          final Move m4 = Move.MoveFactory.createMove(t3.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("d5"), BoardUtils.INSTANCE.getCoordinateAtPosition("d4"));
          final MoveTransition t4 = t3.getToBoard().currentPlayer().makeMove(m4);
          assertTrue(t4.getMoveStatus().isDone());
          final Move m5 = Move.MoveFactory.createMove(t4.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("e2"), BoardUtils.INSTANCE.getCoordinateAtPosition("e4"));
          final MoveTransition t5 = t4.getToBoard().currentPlayer().makeMove(m5);
          assertTrue(t5.getMoveStatus().isDone());
          final Move m6 = Move.MoveFactory.createMove(t5.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("d4"), BoardUtils.INSTANCE.getCoordinateAtPosition("e3"));
          final MoveTransition t6 = t5.getToBoard().currentPlayer().makeMove(m6);
          Assert.assertTrue(t6.getMoveStatus().isDone());
      }
  
      @Test
      public void testEnPassant2() {
          final Board board = Board.createStandardBoard();
          final Move m1 = Move.MoveFactory.createMove(board, BoardUtils.INSTANCE.getCoordinateAtPosition(
                  "e2"), BoardUtils.INSTANCE.getCoordinateAtPosition("e3"));
          final MoveTransition t1 = board.currentPlayer().makeMove(m1);
          assertTrue(t1.getMoveStatus().isDone());
          final Move m2 = Move.MoveFactory.createMove(t1.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("h7"), BoardUtils.INSTANCE.getCoordinateAtPosition("h5"));
          final MoveTransition t2 = t1.getToBoard().currentPlayer().makeMove(m2);
          assertTrue(t2.getMoveStatus().isDone());
          final Move m3 = Move.MoveFactory.createMove(t2.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("e3"), BoardUtils.INSTANCE.getCoordinateAtPosition("e4"));
          final MoveTransition t3 = t2.getToBoard().currentPlayer().makeMove(m3);
          assertTrue(t3.getMoveStatus().isDone());
          final Move m4 = Move.MoveFactory.createMove(t3.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("h5"), BoardUtils.INSTANCE.getCoordinateAtPosition("h4"));
          final MoveTransition t4 = t3.getToBoard().currentPlayer().makeMove(m4);
          assertTrue(t4.getMoveStatus().isDone());
          final Move m5 = Move.MoveFactory.createMove(t4.getToBoard(), BoardUtils.INSTANCE.getCoordinateAtPosition("g2"), BoardUtils.INSTANCE.getCoordinateAtPosition("g4"));
          final MoveTransition t5 = t4.getToBoard().currentPlayer().makeMove(m5);
          assertTrue(t5.getMoveStatus().isDone());
      }
  
      @Test
      public void testKingEquality() {
          final Board board = Board.createStandardBoard();
          final Board board2 = Board.createStandardBoard();
          assertEquals(board.getPiece(60), board2.getPiece(60));
          assertNotNull(board.getPiece(60));
      }
  
      @Test
      public void testHashCode() {
          final Board board = Board.createStandardBoard();
  
          final Set<Piece> allPieces = new HashSet<>();
          for (int idx : board.getWhitePieceCoordinates()) {
              allPieces.add(board.getPiece(idx));
          }
          for (int idx : board.getBlackPieceCoordinates()) {
              allPieces.add(board.getPiece(idx));
          }
  
          assertEquals("Total pieces should be 32", 32, allPieces.size());
          assertEquals("White pieces should be 16", 16, board.getWhitePieceCoordinates().length);
          assertEquals("Black pieces should be 16", 16, board.getBlackPieceCoordinates().length);
      }
  
  }
  