@Test
public void setEachHostScoreTest() {

    List<HostResources> hosts = new ArrayList<HostResources>();
    HostResources spyHost = Mockito.spy(new HostResources());
    hosts.add(spyHost);
    Mockito.doReturn(0d).when(spyAlgorithm).calculateHostScore(Mockito.any(HostResources.class));
    Mockito.doNothing().when(spyHost).setScore(Mockito.anyDouble());
    spyAlgorithm.setEachHostScore(hosts);
    InOrder inOrder = Mockito.inOrder(spyAlgorithm, spyHost);
    inOrder.verify(spyAlgorithm, Mockito.times(hosts.size())).calculateHostScore(Mockito.any(HostResources.class));
    inOrder.verify(spyHost, Mockito.times(hosts.size())).setScore(Mockito.anyDouble());
}