update example with generics