Fixed generics bug in Bag.java