Unexpected behavior from HierarchicalContainer

The HierarchicalContainer maintains added items in Collections on its own level, but also in different Collections in its super classes.
The problem I’m facing is that operations on the HierarchicalContainer (such as ‘moveAfterSibling’) operate on its own Collections and reflect position changes, but the Collections of the super classes are not updated.
This leads to problems as operations implemented by super classes are working on outdated indexes. Consider this test case:


	public void testItemMove() {
		HierarchicalContainer container = new HierarchicalContainer();
		container.addItem("John");
		container.addItem("Doe");

		Assert.assertEquals(container.rootItemIds().size(), 2); //OK
		Iterator<?> iterator = container.rootItemIds().iterator();
		Assert.assertEquals(iterator.next(), "John"); //OK
		Assert.assertEquals(iterator.next(), "Doe"); //OK

		container.moveAfterSibling("John", "Doe"); 

		Assert.assertEquals(container.rootItemIds().size(), 2); //OK
		iterator = container.rootItemIds().iterator();
		Assert.assertEquals(iterator.next(), "Doe"); //OK
		Assert.assertEquals(iterator.next(), "John"); //OK

		Assert.assertTrue(container.isFirstId("Doe")); //FAIL: "Doe" is not firstId
		Assert.assertEquals(container.prevItemId("John"), "Doe"); //FAIL: the previous item for "John" is "null"
	}

As you can see the root items Collection reflects the expected order after the move.
However, operations on one of its super classes (isFirstId and prevItemId) don’t see the change and still believe “John” is the first item followed by “Doe” (while the current status is the other way around). Is this a bug or am I missing something here?

hi,
According to response on :
http://dev.vaadin.com/ticket/5577
it’s a normal behavior.