Make testDuplicateFunctions more robust

Nit: brace should be on next line since this is a class declaration. IDEA formatter should fix this.