test_class.file: org.eclipse.winery.repository/src/test/java/org/eclipse/winery/repository/targetallocation/criteria/minhosts/MinHostsTest.java
test_class.identifier: MinHostsTest
test_class.superclass: extends TestWithGitBackedRepository
test_case.body: @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());
      }
test_case.class_method_signature: MinHostsTest.testFilter()
test_case.full_signature: @Test public void testFilter()
test_case.identifier: testFilter
test_case.invocations: add getTopologyTemplate getElement assertEquals size filter assertEquals size assertEquals size getNodeTemplates get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFilter()
focal_class.file: org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/targetallocation/criteria/minhosts/MinHosts.java
focal_class.identifier: MinHosts
focal_class.class_method_signature: MinHosts.MinHosts(JsonNode params, int outputCap)
focal_class.full_signature: public  MinHosts(JsonNode params, int outputCap)
focal_class.identifier: MinHosts
focal_class.modifiers: public
focal_class.parameters: (JsonNode params, int outputCap)
focal_class.signature:  MinHosts(JsonNode params, int outputCap)
focal_class.class_method_signature: MinHosts.filter(List<TopologyWrapper> topologies)
focal_class.full_signature: @Override public List<TopologyWrapper> filter(List<TopologyWrapper> topologies)
focal_class.identifier: filter
focal_class.modifiers: @Override public
focal_class.parameters: (List<TopologyWrapper> topologies)
focal_class.return: List<TopologyWrapper>
focal_class.signature: List<TopologyWrapper> filter(List<TopologyWrapper> topologies)
focal_class.class_method_signature: MinHosts.generateTargetLabelTopologies(TopologyWrapper topology)
focal_class.full_signature: @Override public List<TopologyWrapper> generateTargetLabelTopologies(TopologyWrapper topology)
focal_class.identifier: generateTargetLabelTopologies
focal_class.modifiers: @Override public
focal_class.parameters: (TopologyWrapper topology)
focal_class.return: List<TopologyWrapper>
focal_class.signature: List<TopologyWrapper> generateTargetLabelTopologies(TopologyWrapper topology)
focal_class.class_method_signature: MinHosts.getPossibleMatches(TopologyWrapper topology)
focal_class.full_signature: @Override protected List<List<PermutationHelper>> getPossibleMatches(TopologyWrapper topology)
focal_class.identifier: getPossibleMatches
focal_class.modifiers: @Override protected
focal_class.parameters: (TopologyWrapper topology)
focal_class.return: List<List<PermutationHelper>>
focal_class.signature: List<List<PermutationHelper>> getPossibleMatches(TopologyWrapper topology)
focal_class.class_method_signature: MinHosts.getPermutations(List<List<PermutationHelper>> possibilities)
focal_class.full_signature: @Override protected List<List<PermutationHelper>> getPermutations(List<List<PermutationHelper>> possibilities)
focal_class.identifier: getPermutations
focal_class.modifiers: @Override protected
focal_class.parameters: (List<List<PermutationHelper>> possibilities)
focal_class.return: List<List<PermutationHelper>>
focal_class.signature: List<List<PermutationHelper>> getPermutations(List<List<PermutationHelper>> possibilities)
focal_class.class_method_signature: MinHosts.toPermutationHelpers(Map<TNodeTemplate, List<TTopologyTemplate>> possibleReplacements)
focal_class.full_signature: private List<List<PermutationHelper>> toPermutationHelpers(Map<TNodeTemplate, List<TTopologyTemplate>> possibleReplacements)
focal_class.identifier: toPermutationHelpers
focal_class.modifiers: private
focal_class.parameters: (Map<TNodeTemplate, List<TTopologyTemplate>> possibleReplacements)
focal_class.return: List<List<PermutationHelper>>
focal_class.signature: List<List<PermutationHelper>> toPermutationHelpers(Map<TNodeTemplate, List<TTopologyTemplate>> possibleReplacements)
focal_class.class_method_signature: MinHosts.toInjectParameter(TopologyWrapper topology, List<PermutationHelper> permutation)
focal_class.full_signature: @Override protected Map<String, TTopologyTemplate> toInjectParameter(TopologyWrapper topology, List<PermutationHelper> permutation)
focal_class.identifier: toInjectParameter
focal_class.modifiers: @Override protected
focal_class.parameters: (TopologyWrapper topology, List<PermutationHelper> permutation)
focal_class.return: Map<String, TTopologyTemplate>
focal_class.signature: Map<String, TTopologyTemplate> toInjectParameter(TopologyWrapper topology, List<PermutationHelper> permutation)
focal_class.superclass: extends CriteriaCommon
focal_method.body: @Override
      public List<TopologyWrapper> filter(List<TopologyWrapper> topologies) {
          int minCount = Collections.min(topologies, Comparator.comparingInt(t -> t.getNodeTemplates().size()))
              .getNodeTemplates().size();
          return topologies.stream().filter(t -> t.getNodeTemplates().size() == minCount).collect(Collectors.toList());
      }
focal_method.class_method_signature: MinHosts.filter(List<TopologyWrapper> topologies)
focal_method.full_signature: @Override public List<TopologyWrapper> filter(List<TopologyWrapper> topologies)
focal_method.identifier: filter
focal_method.invocations: size getNodeTemplates min comparingInt size getNodeTemplates collect filter stream size getNodeTemplates toList
focal_method.modifiers: @Override public
focal_method.parameters: (List<TopologyWrapper> topologies)
focal_method.return: List<TopologyWrapper>
focal_method.signature: List<TopologyWrapper> filter(List<TopologyWrapper> topologies)