void () { String s1 = """ class A { int a = 1; int b; private int c = 2; }"""; String s2 = "@Modifier(\"packageLocal\") '_Type '_Instance = '_Init?;"; String s3 = "public $Type$ $Instance$ = $Init$;"; String expectedResult = """ class A { public int a = 1; public int b; private int c = 2; }"""; assertEquals("Multiple fields replacement", expectedResult, replace(s1, s2, s3, true)); }