I'm attempting to iterate through a list, 'breadthBoard', and add an array to it,'board'. However, each array I add into the array somehow turns into the into a the original array which is then duplicated even though I've tested the array has been changed.
neighbourNodes is a list which contains all the values adjacent to the currentNode on the board.
public List breadthBoard(List neighbourNodes, int [] currentNode, int [][] board)
{
    int x = currentNode[0] - 1; 
    int y = currentNode[1] - 1;
    //create lists
    List breadthBoard = new ArrayList();
for (int i=0; i<3;i++)
        {
            for(int j=0; j<3;j++)
            {
                if (neighbourNodes.contains(board[i][j]))
                {
                    // the temp variables allow me to switch the values then switch back later on
                    int temp = board[i][j];
                    int temp2 = board[x][y];
                    //initial switch
                    board[i][j] = temp2;
                    board[x][y] = temp;// at this point I get a successful swap but it isn't getting added to the breadth board
                    breadthBoard.add(board);
                    //test to see if I get the right results which I do
                    System.out.println("what's being added into breadth board (should be swapped)" + Arrays.deepToString(board)); 
                    System.out.println('\n');
                    switching the values back to the original postions
                    board[i][j] = temp;
                    board[x][y] = temp2;
                    System.out.print("back to normal " + Arrays.deepToString(board));// another test passed
                    System.out.println('\n');
                } 
            }
 
     
    