/** * Intersect takes all elements from list b that appears in * list a and removes them from list a and returns the * manipulated list a. * * @param set The list of items you want to remove * @return the manipulated list * @require this.size() != 0 * @require set.size() != 0 */ @Override public Set intersect(Set set){ int i = 0; while (i< this.size()){ int j = 0; while (j< set.size()){ if (this.get(i).equals(set.get(j))){ this.remove(i); i--; } j++; } i++; } return this; }