title: ObservableList: how to reliably detect a setAll?
body: <p>In some contexts it's necessary to detect - in a ListChangeListener, without control about the list itself - a "all data swapped out", f.i. when we need to clear some state like selection - on completely new data the old state is meaningless. </p>
  
  <p>Completely new data can be reached by</p>
  
  <ul>
  <li>list.setAll(...)</li>
  <li>list.set(otherObservableList)  if list is a ListProperty</li>
  </ul>
  
  <p>Thinking about which type of changes could be fired on setAll (c is the change, items is the observed list, "subChangeCount" pseudo-code for counting the subchanges):</p>
  
  <pre><code>// initially empty
  assertEquals(0, items.size());
  items.setAll(1, 2, 4);
  assertEquals(1, c.subChangeCount());
  assertTrue(c.wasAdded() &amp;&amp; !c.wasReplaced());
  assertEquals(0, c.getFrom());
  assertEquals(c.getList().size(), c.getAddedSize()); 
  
  // initially not empty
  assertTrue(items.size() &gt; 0);
  items.setAll(1, 2, 4);
  assertEquals(1, c.subChangeCount());
  assertTrue(c.wasReplaced());
  assertEquals(0, c.getFrom());
  assertEquals(c.getList().size(), c.getAddedSize()); 
  </code></pre>
  
  <p>This seems to allow a utility check like:</p>
  
  <pre><code>boolean wasSetOrClearedAll(Change c) {
     if (c.getList().isEmpty()) return true;
     c.next();
     if (c.getAddedSize() == c.getList().size()) return true; 
     return false; 
  }  
  </code></pre>
  
  <p>In contrast, internal fx code, f.i. in listening to ComboBox' items:   </p>
  
  <pre><code>while (c.next()) {
     comboBox.wasSetAllCalled = comboBox.previousItemCount == c.getRemovedSize();
     ... 
  }
  comboBox.previousItemCount = getItemCount();
  </code></pre>
  
  <p>stores the old itemCount and compare that against the current removedSize (which I'm uncomfortable with, old state gets stale far too often for my taste), nevertheless there's a good probability that I'm missing something with my approach.</p>
  
  <p>Question is:</p>
  
  <p>in which context would my utility method fail (and core approach would detect the setAll correctly)?</p>