private void sortData() {
		if (!needsSorting()) {
			return;
		}

		List<T> sortData = updatedData.getData();
		if (isCurrentSortReversable()) {
			Collections.reverse(sortData);
		}
		else {
			initializeSortCache();

			maybeSortSourceData();
			doSortData(sortData);

			clearSortCache();
		}

		lastSortContext = monitor.isCancelled() ? null : newSortContext;
		updatedData.setSortContext(lastSortContext);
	}
Work method to sort the data.
Ghidra/Framework/Docking/src/main/java/docking/widgets/table/threaded/TableUpdateJob.java