ConsolidationScoredPreferenceForSmallHosts extends ConsolidationAlgorithmBase { protected void sortHostsUpwardScore(List<HostResources> hosts) { Collections.sort(hosts, hostUpwardScoreComparator); }  @Override List<HostResources> rankHosts(List<HostResources> hostsList); @Override List<HostResources> rankHostToPowerOff(List<HostResources> idleHosts);  }
@Test public void sortHostsUpwardScoreTest() { List<HostResources> hostsToSort = setupOfSortHostTests(); spyAlgorithm.sortHostsUpwardScore(hostsToSort); List<HostResources> expectedHostsOrder = new ArrayList<HostResources>(); expectedHostsOrder.add(createHostResourcesWithScore(0)); expectedHostsOrder.add(createHostResourcesWithScore(3)); expectedHostsOrder.add(createHostResourcesWithScore(5)); expectedHostsOrder.add(createHostResourcesWithScore(12)); checkIfSortIsCorrect(hostsToSort, expectedHostsOrder); }