}
    public void group(Collection<ElementType> collection, Comparator<ElementType> comparator) {	Iterator<ElementType> i = collection.iterator();	ElementType last = null;	while (i.hasNext()) {	    ElementType current = i.next();	    if (last != null && comparator.compare(last, current) == 0) {		// Same group as before		callback.addToGroup(current);	    } else {		// Start of a new group		callback.startGroup(current);	    }	    	    last = current;	}    }