Use generics in tests