void () { final String in = """ abstract class A { abstract void a(); }"""; final String what = "void '_a();"; final String by = "void $a$(int i);"; assertEquals(""" abstract class A { abstract void a(int i); }""", replace(in, what, by)); final String what2 = "abstract void '_a('_T '_p*);"; final String by2 = "void $a$($T$ $p$) {}"; assertEquals(""" abstract class A { void a() {} }""", replace(in, what2, by2)); }