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