@Test public void testCloneBoard() throws Exception { Player p1 = new Player("P1"); Player p2 = new Player("P2"); Cell[][] boardA = Utils.generateInitialBoard(8, 8, p1, p2); Cell cellA = boardA[1][0]; Piece pieceA = cellA.getContents(); Player playerA = pieceA.getPlayer(); Cell[][] boardB = Utils.cloneBoard(boardA); Cell cellB = boardB[1][0]; Piece pieceB = cellB.getContents(); Player playerB = pieceB.getPlayer(); assertNotSame(cellA, cellB); assertNotSame(pieceA, pieceB); assertSame(playerA, playerB); }