Token { public int getCapturingGroupCount() { return capturingGroupCount; } Token(String regex);  Token(String name, String regex);  Token(String name, String regex, String replacement);  Token(String name, String regex, MatchProcessor matchProcessor); String getName(); String getRegex(); int getCapturingGroupCount(); MatchProcessor getMatchProcessor(); @Override String toString();  }
@Test public void testGetCapturingGroupCount() throws Exception { assertEquals(0, new Token("").getCapturingGroupCount()); assertEquals(1, new Token("a(b)c").getCapturingGroupCount()); assertEquals(0, new Token("a(?:b)c").getCapturingGroupCount()); }