void () { final String in = """ class X { private static final int foo = 1; }"""; final String expected = """ class X { protected static final int foo = 1; }"""; assertEquals(expected, replace(in, "private '_Type '_field = '_init;", "protected $Type$ $field$ = $init$;")); }