@Test
public void listInvalidatedForEachElementAdded() throws Exception {

  ObservableList<String> list = new ObservableList<>();
  CountListener listener = new CountListener();
  list.addListener(listener);
  assertThat(listener.getCount()).isEqualTo(0);
  list.add("A");
  list.add("B");
  list.add("C");
  assertThat(listener.getCount()).isEqualTo(3);
}