@Test
public void testAdjustSelection() {

    final int uiColumnIndex = 0;
    final int uiRowIndex = 0;
    final ScenarioGridColumn columnMock = mock(ScenarioGridColumn.class);
    when(columnMock.getIndex()).thenReturn(uiColumnIndex);
    when(scenarioGridModelMock.getColumns()).thenReturn(Collections.singletonList(columnMock));
    final GridData.SelectedCell selectedHeaderCell = mock(GridData.SelectedCell.class);
    when(selectedHeaderCell.getColumnIndex()).thenReturn(uiColumnIndex);
    when(selectedHeaderCell.getRowIndex()).thenReturn(uiRowIndex);
    when(scenarioGridModelMock.getSelectedHeaderCells()).thenReturn(Collections.singletonList(selectedHeaderCell));
    scenarioGridSpy.adjustSelection(mock(SelectionExtension.class), false);
    verify(scenarioGridSpy).signalTestTools();
    verify(scenarioGridSpy).setSelectedColumn(eq(uiColumnIndex));
    verify(eventBusMock).fireEvent(any(EnableTestToolsEvent.class));
    // context menus could be shown
    verify(scenarioContextMenuRegistryMock, times(1)).hideMenus();
    verify(scenarioContextMenuRegistryMock, times(1)).hideErrorReportPopover();
}