@Test
public void setEachHostScoreTest() {

    Mockito.doReturn(1.0).when(spyAlgorithm).calculateHostScore(Mockito.any(HostResources.class));
    List<HostResources> hosts = createHosts();
    spyAlgorithm.setEachHostScore(hosts);
    Mockito.verify(spyAlgorithm, Mockito.times(2)).calculateHostScore(Mockito.any(HostResources.class));
    for (HostResources host : hosts) {
        Assert.assertEquals(1.0, host.getScore(), 0.0);
    }
}