void () { String searchIn = "return ( new String[]{CoreVars.CMUAudioPort + \"\"} );"; String searchFor = "return ( '_A );"; String replaceBy = "return $A$;"; String expectedResult = "return new String[]{CoreVars.CMUAudioPort + \"\"};"; assertEquals("ReplaceReturnWithArrayInitializer", expectedResult, replace(searchIn, searchFor, replaceBy)); }