private boolean isMatch(char c1, char c2) {
        switch (c1) {
        case '(':
            return c2 == ')';
        case '[':
            return c2 == ']';
        case '{':
            return c2 == '}';
        default:
            return false;
        }
    }