Fixes #131 - update example code to use generics.