Converts an anonymous class into a Groovy-style dynamic instantiation.