@Test
public void listInvalidatedOnAddAtIndex() throws Exception {

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