void () { String s1 = """ class X {{ if (true) { int a = 1; } if (true) { int b = 1; } while(true) { int c = 2; } }}"""; String s2 = "[within( \"if ('_a) { '_st*; }\" )]'_type 'a = '_b;"; assertEquals(2,findMatchesCount(s1, s2)); String s2_2 = "[!within( \"if ('_a) { '_st*; }\" )]'_type 'a = '_b;"; assertEquals(1,findMatchesCount(s1, s2_2)); String s3 = """ class X {{ if (true) { if (true) return; int a = 1; } else if (true) { int b = 2; return; } int c = 3; }}"""; assertEquals(2,findMatchesCount(s3, s2)); assertEquals(1,findMatchesCount(s3, s2_2)); }