if (!mergeObject.getClass().equals(this.getClass())) throw new IllegalArgumentException("Bad class " + this.getClass()); SIPHeaderList mergeHdrList = (SIPHeaderList) mergeObject; hlist.mergeObjects(mergeHdrList.hlist);
Iterator it1 = this.listIterator(); Iterator it2 = mergeHdrList.listIterator(); while (it1.hasNext()) { GenericObject outerObj = (GenericObject) it1.next(); while (it2.hasNext()) { Object innerObj = it2.next(); outerObj.merge(innerObj); } }
	public void merge(Object mergeObject) {		if (mergeObject == null)			return;		if (!mergeObject.getClass().equals(this.getClass()))			throw new IllegalArgumentException("Bad class " + this.getClass());		SIPHeaderList mergeHdrList = (SIPHeaderList) mergeObject;		hlist.mergeObjects(mergeHdrList.hlist);	}