### Question:
DefaultEventTableModel extends AbstractTableModel implements AdvancedTableModel<E>, ListEventListener<E> { @Override public int getRowCount() { source.getReadWriteLock().readLock().lock(); try { return source.size(); } finally { source.getReadWriteLock().readLock().unlock(); } } DefaultEventTableModel(EventList<E> source, TableFormat<? super E> tableFormat);  DefaultEventTableModel(EventList<E> source, boolean disposeSource, TableFormat<? super E> tableFormat); @Override TableFormat<? super E> getTableFormat(); @Override void setTableFormat(TableFormat<? super E> tableFormat); @Override E getElementAt(int index); @Override void listChanged(ListEvent<E> listChanges); @Override String getColumnName(int column); @Override int getRowCount(); @Override int getColumnCount(); @Override Class<?> getColumnClass(int columnIndex); @Override Object getValueAt(int row, int column); @Override boolean isCellEditable(int row, int column); @Override void setValueAt(Object editedValue, int row, int column); @Override void dispose(); final TableModelEventAdapter<E> getEventAdapter(); final void setEventAdapter(TableModelEventAdapter<E> eventAdapter);  }### Answer:
@Test @ExecuteOnNonUiThread public void testOnMainThreadEDTViolation() { EventList<Color> colors = new BasicEventList<>(); colors.add(Color.RED); colors.add(Color.GREEN); final TableFormat<Color> colorTableFormat = GlazedLists.tableFormat(new String[] { "red", "green", "blue" }, new String[] { "Red", "Green", "Blue" }); final DefaultEventTableModel<Color> tableModel = new DefaultEventTableModel<>(colors, colorTableFormat); assertEquals(2, tableModel.getRowCount()); try { colors.add(Color.BLUE); fail("failed to receive IllegalStateException because of missing ThreadProxyList"); } catch (IllegalStateException ex) { } }