@Test
public void testFindInstanceByPath() {

	Instance rootInstance = new Instance( "root" );
	Instance current = rootInstance;
	for( int i=1; i<8; i++ ) {
		Instance tempInstance = new Instance( "i-" + i );
		InstanceHelpers.insertChild( current, tempInstance );
		current = tempInstance;
	}
	Assert.assertEquals( "root", InstanceHelpers.findInstanceByPath( rootInstance, "/root" ).getName());
	Assert.assertEquals( "i-4", InstanceHelpers.findInstanceByPath( rootInstance, "/root/i-1/i-2/i-3/i-4" ).getName());
	Assert.assertNull( InstanceHelpers.findInstanceByPath( rootInstance, "whatever" ));
	Assert.assertNull( InstanceHelpers.findInstanceByPath( rootInstance, "/root/whatever" ));
	Assert.assertNull( InstanceHelpers.findInstanceByPath( rootInstance, "/root/i-1/i-3" ));
	Assert.assertNull( InstanceHelpers.findInstanceByPath((Instance) null, "/root/i-1/i-3" ));
	Assert.assertNull( InstanceHelpers.findInstanceByPath( rootInstance, null ));
	Assert.assertNull( InstanceHelpers.findInstanceByPath((Application) null, "/root" ));
}