@Test
public void testFindRootInstance() {

	Instance inst = new Instance( "inst" );
	Assert.assertEquals( inst, InstanceHelpers.findRootInstance( inst ));
	Instance childInstance = new Instance( "child-instance" );
	InstanceHelpers.insertChild( inst, childInstance );
	Assert.assertEquals( inst, InstanceHelpers.findRootInstance( inst ));
	Assert.assertEquals( inst, InstanceHelpers.findRootInstance( childInstance ));
	Instance lastChild = childInstance;
	for( int i=0; i<8; i++ ) {
		Instance tempInstance = new Instance( "child-" + i );
		InstanceHelpers.insertChild( lastChild, tempInstance );
		lastChild = tempInstance;
	}
	Assert.assertEquals( inst, InstanceHelpers.findRootInstance( lastChild ));
}