@Override
		public int compare(T o1, T o2) {
			if (monitor.isCancelled()) {
				throw new SortCancelledException();
			}
			long percentCompleted = ++comparisonCount * 100 / expectedComparisons;
			monitor.setProgress(percentCompleted);
			return delegate.compare(o1, o2);
		}
Wraps a {@link Comparator} to add progress monitoring and cancel checking

@param <T> The type of data being sorted
Ghidra/Framework/Docking/src/main/java/docking/widgets/table/threaded/TableUpdateJob.java