import java.util.*; public class Institution implements Iterable{ Set associates = new HashSet(); public Iterator iterator(){ return associates.iterator(); } public void enroll(T c){ associates.add( c ); } public void withdraw(T c){ associates.remove(c); } public

void merge(Institution

other){ for(P person: other) {other.withdraw( person); this.enroll( person );} } public void test(){ Institution ip = new Institution(); Institution ic = new Institution(); ip.merge(ic); } }