void () { final String s = """ class X { void m() throws RuntimeException, IllegalStateException, IllegalArgumentException {} void n() throws RuntimeException {} void o() throws RuntimeException {} }"""; assertEquals("find method throwing only RuntimeException", 2, findMatchesCount(s, "'_T '_m() throws '_RE:RuntimeException , '_Other{0,0};")); assertEquals("find method throwing RuntimeException and others", 1, findMatchesCount(s, "'_T '_m() throws '_RE:RuntimeException , '_Other{1,100};")); }