@Test @ExecuteOnNonUiThread public void testOnMainThreadEDTViolation() { EventList<Color> colors = new BasicEventList<>(); colors.add(Color.RED); colors.add(Color.GREEN); final DefaultEventListModel<Color> listModel = new DefaultEventListModel<>(colors); assertEquals(2, listModel.getSize()); try { colors.add(Color.BLUE); fail("failed to receive IllegalStateException because of missing ThreadProxyList"); } catch (IllegalStateException ex) { } }
@Override public int getSize() { source.getReadWriteLock().readLock().lock(); try { return source.size(); } finally { source.getReadWriteLock().readLock().unlock(); } }
DefaultEventListModel implements ListEventListener<E>, ListModel<E> { @Override public int getSize() { source.getReadWriteLock().readLock().lock(); try { return source.size(); } finally { source.getReadWriteLock().readLock().unlock(); } } }
DefaultEventListModel implements ListEventListener<E>, ListModel<E> { @Override public int getSize() { source.getReadWriteLock().readLock().lock(); try { return source.size(); } finally { source.getReadWriteLock().readLock().unlock(); } } DefaultEventListModel(EventList<E> source);  DefaultEventListModel(EventList<E> source, boolean disposeSource); }
DefaultEventListModel implements ListEventListener<E>, ListModel<E> { @Override public int getSize() { source.getReadWriteLock().readLock().lock(); try { return source.size(); } finally { source.getReadWriteLock().readLock().unlock(); } } DefaultEventListModel(EventList<E> source);  DefaultEventListModel(EventList<E> source, boolean disposeSource); @Override void listChanged(ListEvent<E> listChanges); @Override E getElementAt(int index); @Override int getSize(); @Override void addListDataListener(ListDataListener listDataListener); @Override void removeListDataListener(ListDataListener listDataListener); void dispose(); }
DefaultEventListModel implements ListEventListener<E>, ListModel<E> { @Override public int getSize() { source.getReadWriteLock().readLock().lock(); try { return source.size(); } finally { source.getReadWriteLock().readLock().unlock(); } } DefaultEventListModel(EventList<E> source);  DefaultEventListModel(EventList<E> source, boolean disposeSource); @Override void listChanged(ListEvent<E> listChanges); @Override E getElementAt(int index); @Override int getSize(); @Override void addListDataListener(ListDataListener listDataListener); @Override void removeListDataListener(ListDataListener listDataListener); void dispose();  }