void () { String s43 = """ public @Deprecated class Foo implements Comparable<Foo> { int x; void m(){} }"""; String s44 = "class 'Class implements '_Interface {}"; String s45 = "@MyAnnotation\n" + "class $Class$ implements $Interface$ {}"; String expectedResult16 = """ @MyAnnotation public @Deprecated class Foo implements Comparable<Foo> { int x; void m(){} }"""; assertEquals( "Preserving class modifiers and generic information in type during replacement", expectedResult16, replace(s43, s44, s45, true) ); String in = """ public class A { int i,j, k; void m1() {} public void m2() {} void m3() {} }"""; String what = """ class '_A { public void '_m(); }"""; String by = """ class $A$ { \tprivate void $m$() {} }"""; assertEquals("Should keep member order when replacing", """ public class A { int i ,j , k; void m1() {} private void m2() {} void m3() {} }""", replace(in, what, by)); }