import java.util.Iterator; public interface Collection extends Iterable{ /**Ensures that this collection contains the specified element*/ public boolean add(E e); /**Adds all of the elements in the specified collection to this collection*/ public boolean addAll(Collection c); /**Removes all of the elements from this collection */ public void clear(); /**Returns true if this collection contains the specified element*/ public boolean contains(Object o); /**Returns true if this collection contains all of the elements in the specified collection*/ public boolean containsAll(Collection c); /**Compares the specified object with this collection for equality*/ public boolean equals(Object o); /**Returns the hash code value for this collection*/ public int hashCode(); /**Returns true if this collection contains no elements*/ public boolean isEmpty(); /**Returns an iterator over the elements in this collection*/ public Iterator iterator(); /**Removes a single instance of the specified element from this collection, if it is present*/ public boolean remove(Object o); /**Removes all of this collection's elements that are also contained in the specified collection*/ public boolean removeAll(Collection c); /**Retains only the elements in this collection that are contained in the specified collection*/ public boolean retainAll(Collection c); /**Returns the number of alements in this collection*/ public int size(); /**Returns an array containing all the elements in this collection*/ public Object[] toArray(); /**Returns an array containing all of the elements in this collection, the runtime type * of the returned array is that of the specified array */ public T[] toArray(T[] a); }