void () { String in = """ public class F { static Category cat = Category.getInstance(F.class.getName()); Category cat2 = Category.getInstance(F.class.getName()); Category cat3 = Category.getInstance(F.class.getName()); }"""; String pattern = "static '_Category '_cat = '_Category.getInstance('_Arg);"; assertEquals(1, findMatchesCount(in, pattern)); String in2 = """ class X { private String s = new String(); }"""; assertEquals(1, findMatchesCount(in2, "'_X '_a = new '_X();")); }