test generic function and the ToStr trait