@Test
public void testFindTemplatesForApplication() {

	List<TemplateEntry> templates = new ArrayList<> ();
	templates.add( new TemplateEntry( new File( "whatever1.tpl" ), null, null, null ));
	templates.add( new TemplateEntry( new File( "whatever2.tpl" ), null, null, null ));
	templates.add( new TemplateEntry( new File( "whatever3.tpl" ), null, null, "app1" ));
	templates.add( new TemplateEntry( new File( "whatever4.tpl" ), null, null, "app1" ));
	templates.add( new TemplateEntry( new File( "whatever5.tpl" ), null, null, "app2" ));
	Collection<TemplateEntry> filteredTemplates = TemplateUtils.findTemplatesForApplication( null, templates );
	Assert.assertEquals( 2, filteredTemplates.size());
	Assert.assertTrue( filteredTemplates.contains( templates.get( 0 )));
	Assert.assertTrue( filteredTemplates.contains( templates.get( 1 )));
	filteredTemplates = TemplateUtils.findTemplatesForApplication( "app2", templates );
	Assert.assertEquals( 3, filteredTemplates.size());
	Assert.assertTrue( filteredTemplates.contains( templates.get( 0 )));
	Assert.assertTrue( filteredTemplates.contains( templates.get( 1 )));
	Assert.assertTrue( filteredTemplates.contains( templates.get( 4 )));
	filteredTemplates = TemplateUtils.findTemplatesForApplication( "app1", templates );
	Assert.assertEquals( 4, filteredTemplates.size());
	Assert.assertTrue( filteredTemplates.contains( templates.get( 0 )));
	Assert.assertTrue( filteredTemplates.contains( templates.get( 1 )));
	Assert.assertTrue( filteredTemplates.contains( templates.get( 2 )));
	Assert.assertTrue( filteredTemplates.contains( templates.get( 3 )));
	filteredTemplates = TemplateUtils.findTemplatesForApplication( "app3", templates );
	Assert.assertEquals( 2, filteredTemplates.size());
	Assert.assertTrue( filteredTemplates.contains( templates.get( 0 )));
	Assert.assertTrue( filteredTemplates.contains( templates.get( 1 )));
}