BracketMatcher { public static int getClosingTagIndex(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 matchTag() { assertEquals(2, BracketMatcher.getClosingTagIndex("<a>", 0)); }