Returns .true if the Bag
contains the member item item,
otherwise returns .false.
If index is specified, it should be
the same object as index,
otherwise hasItem will always return .false.
Item and index equality is determined by using the == method.