private boolean checkForCheckmate(int colorOfKingPotentiallyDefeated) {
        //if at least one piece in that color has a possible move there is no checkmate
        for (int column = 0; column < 8; column++) {
            for (int row = 0; row < 8; row++) {
                if (pieces[column][row] != null
                    && pieces[column][row].getColor() == colorOfKingPotentiallyDefeated) {

                    ArrayList<BoardPosition> possibleMoves;
                    possibleMoves = pieces[column][row].getPossibleMoves(this, new BoardPosition(column, row));
                    filterMovesCausingCheck(possibleMoves, new BoardPosition(column, row));
                    if (possibleMoves.size() > 0) {
                        return false;
                    }
                }
            }
        }
        return true;
    }