void () { String source = """ import java.io.Externalizable; import java.io.Serializable; abstract class MyClass implements Serializable, java.util.List, Externalizable {}"""; String search = "class 'TestCase implements java.util.List, '_others* {\n '_MyClassContent\n}"; String replace = "class $TestCase$ implements $others$ {\n $MyClassContent$\n}"; String expectedResult = """ import java.io.Externalizable; import java.io.Serializable; abstract class MyClass implements Serializable, Externalizable { \s }"""; assertEquals(expectedResult, replace(source, search, replace, true)); }