long lastTimestamp = collectionToUpdate.getSequenceNumber();
long lastSequence = origCollection.getSequenceNumber();
	public void execute() {		SortedSet<BugInstance> origSetExact = collectionToExactSet(collectionToUpdate);		SortedSet<BugInstance> newSetExact = collectionToExactSet(newCollection);				SortedSet<BugInstance> origSetFuzzy = collectionToFuzzySet(collectionToUpdate);		SortedSet<BugInstance> newSetFuzzy = collectionToFuzzySet(newCollection);				long lastTimestamp = collectionToUpdate.getSequenceNumber();				// We assign a timestamp to the new collection as one greater than the		// original collection.		long currentTimestamp = collectionToUpdate.getSequenceNumber() + 1;				// Handle warnings which are in the original bug collection		// (and possibly in the new one).		for (Iterator<BugInstance> i = origSetExact.iterator(); i.hasNext();) {			BugInstance origInstance = i.next();						BugInstance correspondingNewInstance = findMatching(newSetFuzzy, origInstance);			SequenceIntervalCollection updatedActiveCollection = origInstance.getActiveIntervalCollection();			updateActiveIntervalCollection(					lastTimestamp, currentTimestamp, updatedActiveCollection);						if (correspondingNewInstance != null) {				// Combine the new and orig instances				//				// From original, keep:				// - unique id				// - BugProperty list (classifications, &c.)				// - annotation text				//				// If the original instance was active in the most recent update				// (timestamp), extend the interval containing that timestamp to				// include the current timestamp.				//				// All other information taken from new instance.								// This operation is implemented by copying the required information				// into the new instance and replacing the original instance				// with the new instance.				correspondingNewInstance.setUniqueId(origInstance.getUniqueId());				copyBugProperties(origInstance, correspondingNewInstance);				correspondingNewInstance.setAnnotationText(origInstance.getAnnotationText());								correspondingNewInstance.setActiveIntervalCollection(updatedActiveCollection);								collectionToUpdate.remove(origInstance);				collectionToUpdate.add(correspondingNewInstance);			} else {				// BugInstance exists in original set, but not in new set.								// If the orig bug instance is not part of the set of updated classes,				// then we mark it active anyway, assuming that it still exists,				// but the analysis didn't look at that class.  Otherwise, we leave				// the active collection as-is, meaning that the instance won't				// be considered active any more.								if (updatedClassNameSet != null) {					ClassAnnotation primaryClass = origInstance.getPrimaryClass();					if (primaryClass != null && updatedClassNameSet.contains(primaryClass.getClassName())) {						origInstance.setActiveIntervalCollection(updatedActiveCollection);					}				}			}		}				// Handle warnings that are only in the new collection.		// This is easy: just copy them into the orig collection.		for (Iterator<BugInstance> i = newSetExact.iterator(); i.hasNext();) {			BugInstance newInstance = i.next();						BugInstance correspondingOrigInstance = findMatching(origSetFuzzy, newInstance);			if (correspondingOrigInstance == null) {				// Note that the BugCollection will assign a new unique id				// to the new instance, so that it won't conflict with				// existing uids.				collectionToUpdate.add(newInstance);			}		}				// Update the timestamp		collectionToUpdate.setSequenceNumber(currentTimestamp);	}