### Question:
ColumnDefinitionTableModel extends AbstractTableModel { public void addRows(List<ColumnDefinitionRow> rows) { myRows.addAll(rows); if (!myRows.isEmpty()) { fireTableRowsInserted(0, myRows.size() - 1); } }  void addRows(List<ColumnDefinitionRow> rows); void clear(); @Override Class<?> getColumnClass(int columnIndex); @Override int getColumnCount(); @Override String getColumnName(int column); ColumnDefinitionRow getRow(int rowIndex); @Override int getRowCount(); @Override Object getValueAt(int rowIndex, int columnIndex); @Override boolean isCellEditable(int rowIndex, int columnIndex); boolean isImportAllColumns(); void setFormatEditable(boolean isEditable); @Override void setValueAt(Object aValue, int rowIndex, int columnIndex);  }### Answer:
@Test public void testAddRows() { EasyMockSupport support = new EasyMockSupport(); final List<ColumnDefinitionRow> rows = createTestRows(); TableModelListener listener = support.createMock(TableModelListener.class); listener.tableChanged(EasyMock.isA(TableModelEvent.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Void>() { @Override public Void answer() { TableModelEvent event = (TableModelEvent)EasyMock.getCurrentArguments()[0]; assertEquals(0, event.getFirstRow()); assertEquals(rows.size() - 1, event.getLastRow()); assertEquals(TableModelEvent.INSERT, event.getType()); return null; } }); support.replayAll(); ColumnDefinitionTableModel model = new ColumnDefinitionTableModel(); model.addTableModelListener(listener); model.addRows(New.<ColumnDefinitionRow>list()); model.addRows(rows); assertEquals(rows.size(), model.getRowCount()); for (int i = 0; i < rows.size(); i++) { assertEquals(rows.get(i).isImport(), model.getValueAt(i, 0)); assertEquals(rows.get(i).getColumnName(), model.getValueAt(i, 1)); assertEquals(rows.get(i).getDataType(), model.getValueAt(i, 2)); assertEquals(rows.get(i).getFormat(), model.getValueAt(i, 3)); } support.verifyAll(); }