@Test
public void testFilter() throws Exception {

    List<TopologyWrapper> topologies = new ArrayList<>();
    for (int i = 1; i < 5; i++) {
        ServiceTemplateId id = new ServiceTemplateId("http://www.winery.opentosca.org/test/targetallocation/servicetemplates",
            "TargetAllocationMinHostsTest" + i, false);
        topologies.add(new TopologyWrapper(repository.getElement(id).getTopologyTemplate()));
    }
    assertEquals(4, topologies.size());
    Criteria minHosts = new MinHosts(null, Integer.MAX_VALUE);
    List<TopologyWrapper> filtered = minHosts.filter(topologies);
    assertEquals(2, filtered.size());
    assertEquals(5, filtered.get(0).getNodeTemplates().size());
}