extended code generator to handle collections of primitive types