Use generics in Bag