AllocationAlgorithmBase implements AllocationAlgorithm { @Override public List<HostResources> rankHostsToStart(List<HostResources> hostsResources) { return cloneListOfHosts(hostsResources); }  @Override List<ClusterResourcesAvailableToStart> rankClustersToAllocation(List<ClusterResourcesAvailableToStart> clusters); @Override boolean needsToActivateHost(CloudResources cloudCapacity); @Override List<HostResources> rankHostsToStart(List<HostResources> hostsResources);  }
@Test public void rankHostsToStartTest() { List<HostResources> hosts = new ArrayList<HostResources>(); Mockito.doReturn(hosts).when(spyAlgorithm).cloneListOfHosts(hosts); List<HostResources> clonedHostsToStart = spyAlgorithm.rankHostsToStart(hosts); Mockito.verify(spyAlgorithm).cloneListOfHosts(hosts); Assert.assertEquals(hosts, clonedHostsToStart); }