void restoreSelection() {
			if (tableSelectionState == NO_SELECTION_TRACKING) {
				return;
			}

			int rowCount = matchesTableModel.getRowCount();
			if (rowCount == 0) {
				// nothing to select; don't erase the memento, we may be asked again to restore
				return;
			}

			selectionMemento = null;// clear the selection memento

			ListSelectionModel selectionModel = matchesTable.getSelectionModel();
			int rowToSelect = row;
			if (row > matchesTableModel.getRowCount()) {
				// The model has shrunk. Not sure what the best action is?
				tryToSelectMatch(selectionModel);// this only works if we are tracking by match and not index
				return;
			}

			// At this point the selection model may still believe that its selection is the
			// value we are setting. Calling clearSelection() will kick the model. Without
			// the
			// kick, the setSelectionInterval() call we make may ultimately have no effect.
			selectionModel.clearSelection();

			if (tableSelectionState == MAINTAIN_SELECTED_ROW_INDEX) {
				// In this state we are tracking row selection, so just select the previously
				// selected row.
				selectionModel.setSelectionInterval(rowToSelect, rowToSelect);
				matchesTable.scrollToSelectedRow();
			}
			else if (tableSelectionState == MAINTAIN_SELECTED_ROW_VALUE) {
				tryToSelectMatch(selectionModel);
			}
			else {
				throw new AssertException(
					"Unhandled " + TableSelectionTrackingState.class.getSimpleName() +
						" value--a new state " + "must have been added");
			}
		}
A class meant to override the default table selection behavior <b>in special
situations</b>.
<p>
<u>Issue 1:</u> Accepting or applying a match can trigger the match to be
filtered out of the table. The default SelectionManager does not restore the
selection for that item, as it knows that the item is gone.
<p>
<u>Issue 2:</u> Accepting or applying a match can trigger the match to be
moved due to a sort operation after the edit.
<p>
<u>Desired Behavior:</u> Have the selection restored to the previous
location, even if the item is moved or removed.
<p>
Creating this object will cancel the default behavior. Calling
{@code restoreSelection} will set the new selection, depending upon the
conditions described above.
Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/VTMatchTableProvider.java