### Question:
TableSelectEntireRowsCommand extends AbstractTableDependedCommand { @Override public void execute(){ getTable().setColumnSelectionInterval(0, getTable().getColumnCount()-1); } TableSelectEntireRowsCommand(JTable table); @Override void execute();  }### Answer:
@Test public void testSelectSingleRow() throws Exception { table.setRowSelectionInterval(0, 0); table.setColumnSelectionInterval(0, 0); classUnderTest.execute(); assertEquals(0, table.getSelectedRows()[0]); assertEquals(2, table.getSelectedColumnCount()); assertEquals(1, table.getSelectedRowCount()); }
@Test public void testSelectMultibleRows() throws Exception { table.setRowSelectionInterval(1, 2); table.setColumnSelectionInterval(1, 1); classUnderTest.execute(); assertEquals(1, table.getSelectedRows()[0]); assertEquals(2, table.getSelectedRows()[1]); assertEquals(2, table.getSelectedColumnCount()); assertEquals(2, table.getSelectedRowCount()); }