import java.util.Collection;

/**
 * A data type representing an unordered collection of items, possibly 
 * including duplicates.
 *
 * @author Mark Young (A00000000)
 */
public interface Bag<T> extends Collection<T> {
    
    /**
     * Remove an item from this Bag. The item to remove is at the discretion of
     * the implementation.
     *
     * @return an arbitrary item removed from this Bag
     * @throws java.util.NoSuchElementException if the Bag was empty
     */
    public T remove();

    /**
     * Count how many times the given item appears in this Bag. An item gets
     * counted if {@code Objects.equals} reports it equal to the given item.
     *
     * @param anItem the item to count
     * @return how many copies of that item appear in this Bag
     */
    public int getFrequency(T anItem);

}
