Make testDuplicateFunctions more robust

Is there a way to make IntelliJ generate the code with the correct formatting, in the first place?