Notice the removal of type parameter in TemplateGenerator.groupWhile. I am not sure what was intended (this method is currently unused).