void () { String s1 = """ /** * Created by IntelliJ IDEA. * User: cdr * Date: Nov 15, 2005 * Time: 4:23:29 PM * To change this template use File | Settings | File Templates. */ public class CC { /** My Comment */ int a = 3; // aaa // bbb long c = 2; void f() { } }"""; String s2 = """ /** * Created by IntelliJ IDEA. * User: '_USER * Date: '_DATE * Time: '_TIME * To change this template use File | Settings | File Templates. */ class 'c { '_other* }"""; String s3 = """ /** * by: $USER$ */ class $c$ { $other$ }"""; String expectedResult = """ /** * by: cdr */ public class CC { /** My Comment */ int a = 3; // aaa // bbb long c = 2; void f() { } }"""; assertEquals("Class with comment replacement", expectedResult, replace(s1, s2, s3, true)); }