public boolean areBracketsValid(String content) {
        int openBrackets = 0;
        for (char c : content.toCharArray()) {
            if (c == openingBracket)
                openBrackets++;
            else if (c == closingBracket) {
                openBrackets--;
                if (openBrackets < 0)
                    return false;
            }
        }
        return openBrackets == 0;
    }