
public interface IntMultiSet {

	/**
	 * Add a new element to this set.
	 *
	 * @param element
	 *            the new element that is being inserted
	 * @postcondition A new copy of the element has been added to this set.
	 **/
	void add(int element);

	/**
	 * Add new elements to this set.
	 *
	 * @param elements
	 *            (a variable-arity argument) one or more new elements that are
	 *            being inserted
	 * @postcondition A new copy of the element has been added to this set.
	 **/
	void addMany(int... elements);

	/**
	 * Add the contents of another set to this set.
	 *
	 * @param other
	 *            a set whose contents will be added to this set
	 * @precondition The parameter, other, is not null.
	 * @postcondition The elements from other have been added to this set.
	 * @exception NullPointerException
	 *                Indicates that other is null.
	 **/
	void addAll(IntMultiSet other);

	/**
	 * Accessor method to count the number of occurrences of a particular element in
	 * this set.
	 *
	 * @param target
	 *            the element that needs to be counted
	 * @return the number of times that target occurs in this set
	 **/
	int countOccurrences(int target);

	/**
	 * Remove one copy of a specified element from this set.
	 *
	 * @param target
	 *            the element to remove from the set
	 * @return If target was found in the set, then one copy of target has been
	 *         removed and the method returns true. Otherwise the set remains
	 *         unchanged and the method returns false.
	 **/
	boolean remove(int target);

	/**
	 * Determine the number of elements in this set.
	 *
	 * @return the number of elements in this set
	 **/
	int size();
	
	/**
     * Create a new set that contains all the elements from two other sets.
     *
     * @param b1
     *            the first of two sets
     * @param b2
     *            the second of two sets
     * @precondition Neither b1 nor b2 is null
     * @return the union of b1 and b2
     * @exception NullPointerException
     *                Indicates that one of the arguments is null.
     * @exception OutOfMemoryError
     *                Indicates insufficient memory for the new set.
     **/
	static IntMultiSet union (IntMultiSet a, IntMultiSet b) {
		IntMultiSet c = new IntArrayMultiSet();
		c.addAll(a);
		c.addAll(b);
		return c;
	}

}