final List<Object> toRemove = new ArrayList<Object>(n);
final List<Object> toAdd = new ArrayList<Object>(n);
final List<Object> toUpdate = new ArrayList<Object>(n);
for (final Object element : updatedElements) {
if (fResult.getMatchCount(element) > 0) {
if (viewer.testFindItem(element) != null) {
toUpdate.add(element);
} else {
if (!treeLimited || viewer.getTree().getItemCount() < elementLimit) {
toAdd.add(element);
}