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