Enhancement
In scripted tests it should be possible to check the selection of components. For Selectable this is only possible if they are also SelectionModelOwner.
The TreeTableComponent, for example, is not: it stores the selection in the TableViewModel. This has a SelectionModel, but not a com.top_logic.mig.html.SelectionModel but a javax.swing.ListSelectionModel. Therefore, the selection in TreeTableComponents cannot be checked yet.
Implementation: The SelectableSelectionNaming returns the selection of a selectable.
Test
TestTreeTableSelectionAfterCollapse.script.xml from #24680.