A bag is a container class that holds a collection of objects that are placed in it. The objects are not stored in any particular order and the bag may contain duplicates. A bag object can do the following:
- Add one or more items
- Determine how many times an item appears in the bag
- Remove an item
- Display the contents of the bag
- Determine if two bags are equal
- Combine the contents of one bag with another
- Combine the contents of two bags into a new bag
Write an interface for a BagADT that implements the Iterable interface. Include javadoc comments that will generate specifications for the BagADT so that someone who wants to implement this interface will know what each method does.