void () { String s = "class X {{ Integer i; i.valueOf(); }}"; assertEquals(1, findMatchesCount(s, "Integer '_i;\n'_i.valueOf();")); String s_2 = "class X {{ Integer i; int a = 1; i.valueOf(); }}"; assertEquals(1, findMatchesCount(s_2, "Integer '_i;\n'_st; '_i.valueOf();")); String pattern = "Integer '_i;\n'_st*; '_i.valueOf();"; assertEquals(1, findMatchesCount(s_2, pattern)); assertEquals(1, findMatchesCount(s, pattern)); }