Bug 126839 [DataBinding] IObservable refactoring
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/beans/JavaBeanTree.java
}
	
	private void trackChildren(Object parentElement, Object[] children) {
		Object key = parentElement==null?JavaBeanTree.this : parentElement;
		TreeNode node = (TreeNode) nodes.get(key);
		Set removed = new HashSet(node.getChildren());
		List newList = children==null? new ArrayList(): Arrays.asList(children);
		if (children!=null) {
			for (int i=0; i<children.length; i++) {
				if (!removed.remove(children[i])) {
					
					TreeNode child = new TreeNode(parentElement);
					nodes.put(children[i], child);
				}				
			}
		}
		for (Iterator itr=removed.iterator(); itr.hasNext();) {
			nodes.remove(itr.next());
		}
		node.setChildren(newList);
	}
	public void setChildren(Object parentElement, Object[] children) {
		if (parentElement==null) {
			throw new BindingException ("Changing root element/s is not supported"); 
		}
		
		Method[] setters = getWriteMethods(parentElement);
		
		if (setters==null || setters.length!=1) {
			throw new BindingException("Can not determine children set method for: "+parentElement.getClass().getName());