private void doSetTableSortState(final TableSortState newSortState) {
		if (newSortState.equals(pendingSortState)) {
			return; // there is an upcoming sort that matches the current request
		}

		// no pending event, is the current state different?
		if (newSortState.equals(sortState) && pendingSortState == null) {
			return; // the current state matches our request
		}

		isSortPending = true;
		pendingSortState = newSortState;
		Swing.runLater(() -> sort(getModelData(), createSortingContext(newSortState)));
	}
A convenience method that will take a given sort state and remove from it any columns
that cannot be sorted.  This is useful if the client is restoring a sort state that
contains columns that have been removed or are no longer sortable (such as during major
table model rewrites).

@param state the state
@return the updated state
Ghidra/Framework/Docking/src/main/java/docking/widgets/table/AbstractSortedTableModel.java