TreeTable not adding children correctly

Hi,

I’m using a TreeTable in my application where childrens are add by a button click.

My problem is when I click, the children is add at the end of the container even if I use the setParent method() and updating the wrapper after.

Here my test :

@Override
	public void init() {
		Window mainWindow = new Window("Budget Application");
		Label label = new Label("Hello Vaadin user");
		mainWindow.addComponent(label);
		setMainWindow(mainWindow);
		
		Pojo p1 = new Pojo("1");
		Pojo p2 = new Pojo("2");
		final Pojo p3 = new Pojo("3");
		Pojo p4 = new Pojo("4");
		Pojo p5 = new Pojo("5");
		
		List<Pojo> pojos = new ArrayList<Pojo>();
		pojos.add(p1);
		pojos.add(p2);
		pojos.add(p3);
		pojos.add(p4);
		pojos.add(p5);
		
		final BeanItemContainer<Pojo> container = new BeanItemContainer<Pojo>(Pojo.class);
		container.addAll(pojos);
		
		final ContainerHierarchicalWrapper wrapper = new ContainerHierarchicalWrapper(container);
		final TreeTable t = new TreeTable();
		t.setImmediate(true);
		t.setWidth("100%");
		t.setContainerDataSource(wrapper);
		
		mainWindow.addComponent(t);
		
		Button b = new Button("Clic");
		b.addListener(new ClickListener() {
			
			public void buttonClick(ClickEvent event) {
				Pojo p31 = new Pojo("3-1");
				wrapper.addItem(p31);
				wrapper.setParent(p31, p3);
				wrapper.updateHierarchicalWrapper();

			}
		});
		
		mainWindow.addComponent(b);
		
		
	}

Thanks in advance.