Nowhere in the documentation it mentions that the type T must have a no-arg constructor for this to work. Please specify in the documentation explicitly, otherwise figuring it out may cost a lot of time to the developer like it did for me.