void () { String s1 = """ class A { /* */ void a() { } /* */ int b = 1; /* * */ class C {} { /* aaa */ int a; /* */ a = 1; } }"""; String s2 = "/* 'a:[regex( .* )] */"; String s2_2 = "/* */"; String s3 = ""; String expectedResult = """ class A { void a() { } int b = 1; class C { } { int a; a = 1; } }"""; options.setToReformatAccordingToStyle(true); assertEquals("Removing comments", expectedResult, replace(s1, s2, s3)); options.setToReformatAccordingToStyle(false); String expectedResult2 = """ class A { void a() { } int b = 1; /* * */ class C {} { /* aaa */ int a; a = 1; } }"""; assertEquals("Removing comments", expectedResult2, replace(s1, s2_2, s3)); }