@Test
public void testUpdateImports() {

	Map<String,Collection<Import>> prefixToImports = new HashMap<String,Collection<Import>> ();
	prefixToImports.put( "comp", Arrays.asList(
			new Import( "/root1", "comp1" ),
			new Import( "/root2", "comp1" )));
	Instance inst = new Instance( "inst" );
	Assert.assertEquals( 0, inst.getImports().size());
	ImportHelpers.updateImports( inst, prefixToImports );
	Assert.assertEquals( 1, inst.getImports().size());
	Iterator<Import> iterator = inst.getImports().get( "comp" ).iterator();
	Assert.assertEquals( "/root1", iterator.next().getInstancePath());
	Assert.assertEquals( "/root2", iterator.next().getInstancePath());
	Assert.assertFalse( iterator.hasNext());
	prefixToImports.put( "comp", Arrays.asList( new Import( "/root1", "comp1" )));
	ImportHelpers.updateImports( inst, prefixToImports );
	Assert.assertEquals( 1, inst.getImports().size());
	iterator = inst.getImports().get( "comp" ).iterator();
	Assert.assertEquals( "/root1", iterator.next().getInstancePath());
	Assert.assertFalse( iterator.hasNext());
	ImportHelpers.updateImports( inst, null );
	Assert.assertEquals( 0, inst.getImports().size());
}