for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) { BugInstance warning = i.next();
Iterator<BugInstance> iter;  if (comparator != null) {   Set<BugInstance> set = new TreeSet<BugInstance>(comparator); set.addAll(bugCollection.getCollection()); iter = set.iterator(); } else { iter = bugCollection.iterator(); }  while (iter.hasNext()) { BugInstance warning = iter.next();
	public CountBugs2 execute() {		for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) {			BugInstance warning = i.next();			BugPattern pattern = warning.getBugPattern();			if (pattern == null ) {				System.err.println("Null pattern for " + warning.getType());				if (!categorySet.isEmpty() || !abbrevSet.isEmpty()) {					if (DEBUG) System.err.println("skipping for nonempty category or abbrev set");					continue;				}			}						if (!categorySet.isEmpty()					&& !categorySet.contains(pattern.getCategory())) {				if (DEBUG) System.out.println("Mismatched category: " + pattern.getCategory());				continue;			}						if (!abbrevSet.isEmpty()					&& !abbrevSet.contains(pattern.getAbbrev())) {				if (DEBUG) System.out.println("Mismatched abbrev: " + pattern.getAbbrev());				continue;			}						if (warning.getPriority() > minPriority)				continue;						++count;		}		return this;	}