@Test public void testPropertyChanges() { final EventList<String> source = new BasicEventList<>(); source.add("a"); final PropertyChangeCounter counter = new PropertyChangeCounter(); final Calculation<Integer> count = Calculations.count(source); count.addPropertyChangeListener(counter); assertEquals(1, count.getValue().intValue()); assertEquals(0, counter.getCountAndReset()); source.add("a"); assertEquals(2, count.getValue().intValue()); assertEquals(1, counter.getCountAndReset()); source.set(1, "b"); assertEquals(2, count.getValue().intValue()); assertEquals(0, counter.getCountAndReset()); source.remove(1); assertEquals(1, count.getValue().intValue()); assertEquals(1, counter.getCountAndReset()); }
public Count(EventList source) { super(new Integer(source.size())); this.source = source; this.source.addListEventListener(this); }
Count extends AbstractCalculation<Integer> implements ListEventListener { public Count(EventList source) { super(new Integer(source.size())); this.source = source; this.source.addListEventListener(this); } }
Count extends AbstractCalculation<Integer> implements ListEventListener { public Count(EventList source) { super(new Integer(source.size())); this.source = source; this.source.addListEventListener(this); } Count(EventList source); }
Count extends AbstractCalculation<Integer> implements ListEventListener { public Count(EventList source) { super(new Integer(source.size())); this.source = source; this.source.addListEventListener(this); } Count(EventList source); @Override void dispose(); @Override void listChanged(ListEvent listChanges); }
Count extends AbstractCalculation<Integer> implements ListEventListener { public Count(EventList source) { super(new Integer(source.size())); this.source = source; this.source.addListEventListener(this); } Count(EventList source); @Override void dispose(); @Override void listChanged(ListEvent listChanges);  }