Bug 127861 [DataBinding] Mark API provisional
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/UpdatableSetContentProvider.java
Collection oldCollection = readableSet.toCollection();
        Collection newCollection = newSet.toCollection();
        HashSet additions = new HashSet();
        HashSet removals = new HashSet();
        
        additions.addAll(newCollection);
        additions.removeAll(oldCollection);
        
        removals.addAll(oldCollection);
        removals.removeAll(newCollection);
        
        readableSet = newSet;
        doAdd(additions, updateViewer);
        doRemove(removals, updateViewer);
        
        if (readableSet != null) {
        	readableSet.addChangeListener(listener);
        }
        
        boolean isStale = (readableSet != null && readableSet.isStale());
        if (isStale != wasStale) {
        	elements.doFireStale(isStale);
        }
    }
    private boolean isDisposed() {
        return viewer.getControl() == null || viewer.getControl().isDisposed();
    }
}