public void capturePiece(BoardPosition positionOfDefeated, BoardPosition positionOfWinner) {
        if (pieces[positionOfDefeated.getColumn()][positionOfDefeated.getRow()] != null) {
            if (pieces[positionOfDefeated.getColumn()][positionOfDefeated.getRow()].getColor() == Board.BLACK_COLOR) {
                capturedBlack.add(pieces[positionOfDefeated.getColumn()][positionOfDefeated.getRow()]);
            } else {
                capturedWhite.add(pieces[positionOfDefeated.getColumn()][positionOfDefeated.getRow()]);
            }
        } else if (enPassantPosition != null && positionOfDefeated.equals(enPassantPosition)) {
            if (pieces[enPassantPawnPosition.getColumn()][enPassantPawnPosition.getRow()].getColor() == Board.BLACK_COLOR) {
                capturedBlack.add(pieces[enPassantPawnPosition.getColumn()][enPassantPawnPosition.getRow()]);
            } else {
                capturedWhite.add(pieces[enPassantPawnPosition.getColumn()][enPassantPawnPosition.getRow()]);
            }
            pieces[enPassantPawnPosition.getColumn()][enPassantPawnPosition.getRow()] = null;
        }
        pieces[positionOfDefeated.getColumn()][positionOfDefeated.getRow()] = pieces[positionOfWinner.getColumn()][positionOfWinner.getRow()];
        pieces[positionOfWinner.getColumn()][positionOfWinner.getRow()] = null;
    }