void () { String s1 = """ public class CC { /** AAA*/ int b = 1; // comment }"""; String s2 = "int b = 1;"; String s3 = "long c = 2;"; String expectedResult = """ public class CC { /** AAA*/ long c = 2; // comment }"""; assertEquals("Class field replacement with simple pattern", expectedResult, replace(s1, s2, s3, true)); }