@Test
@SuppressWarnings( "unchecked" )
public void testFindTemplate() throws Exception {

	Map<ApplicationTemplate,Boolean> map = TestUtils.getInternalField( this.mngr, "templates", Map.class );
	Assert.assertNull( this.mngr.findTemplate( "lamp", null ));
	ApplicationTemplate tpl = new ApplicationTemplate( "lamp" );
	map.put( tpl, Boolean.TRUE );
	Assert.assertEquals( tpl, this.mngr.findTemplate( "lamp", null ));
	ApplicationTemplate tpl2 = new ApplicationTemplate( "lamp" ).version( "v2" );
	map.put( tpl2, Boolean.TRUE );
	Assert.assertFalse( tpl.equals( tpl2 ));
	Assert.assertEquals( tpl2, this.mngr.findTemplate( "lamp", "v2" ));
	Assert.assertEquals( tpl, this.mngr.findTemplate( "lamp", null ));
	Assert.assertNull( this.mngr.findTemplate( "lamp", "v3" ));
	Assert.assertNull( this.mngr.findTemplate( "lamp2", null ));
}