void () { String s1 = """ int a = 1; a = 2; int b = a; b2 = 3;"""; String s2 = """ int '_a = '_i; '_st*; '_a = '_c;"""; String s3 = "$st$;\n" + "$c$ = $i$;"; String expected = """ 2 = 1; int b = a; b2 = 3;"""; assertEquals(expected, replace(s1, s2, s3)); String s2_2 = """ int '_a = '_i; '_st*; int '_c = '_a;"""; String s3_2 = "$st$;\n" + "int $c$ = $i$;"; String expected_2 = """ a = 2; int b = 1; b2 = 3;"""; assertEquals(expected_2, replace(s1, s2_2, s3_2)); }