BracketMatcher { public static int getClosingCurlyBraceIndex(CharSequence chars, int startIndex) { return getClosingBracketIndex(chars, startIndex, "{", "}"); }  static int getClosingParenthesisIndex(CharSequence chars, int startIndex); static int getClosingSquareBracketIndex(CharSequence chars, int startIndex); static int getClosingCurlyBraceIndex(CharSequence chars, int startIndex); static int getClosingTagIndex(CharSequence chars, int startIndex); static int getClosingBracketIndex(CharSequence chars, int startIndex, String openBracket, String closeBracket);  }
@Test public void matchCurlyBrace() { assertEquals(2, BracketMatcher.getClosingCurlyBraceIndex("{a}", 0)); }