@Test
public void testGetAllInstances() {

	Application app = new Application( new ApplicationTemplate());
	Instance[] rootInstances = new Instance[ 8 ];
	for( int i=0; i<rootInstances.length; i++ ) {
		rootInstances[ i ] = new Instance( "i-" + i );
		InstanceHelpers.insertChild( rootInstances[ i ], new Instance( "child-" + i ));
	}
	app.getRootInstances().addAll( Arrays.asList( rootInstances ));
	List<Instance> allInstances = InstanceHelpers.getAllInstances( app );
	Assert.assertEquals( rootInstances.length * 2, allInstances.size());
	for( Instance rootInstance : rootInstances )
		Assert.assertTrue( rootInstance.getName(), allInstances.contains( rootInstance ));
}