@Test
public void mapVMsToHostTest() {

    HostResources h0 = createHostWithSmallVms(2);
    HostResources h1 = createHostWithSmallVms(1);
    HostResources h2 = createHostWithMediumVms(2);
    List<HostResources> hostsList = new ArrayList<HostResources>();
    hostsList.add(h0);
    hostsList.add(h1);
    hostsList.add(h2);
    List<HostResources> rankedHosts = vmsDistributionAlgorithm.rankHosts(hostsList);
    Map<Long, HostResources> mapTest = vmsDistributionAlgorithm.mapVMsToHost(rankedHosts);
    Assert.assertEquals(1, mapTest.size());
    long mapValues[] = new long[mapTest.size()];
    for (HostResources host : mapTest.values()) {
        mapValues[0] = host.getUsedMemoryInMegaBytes();
    }
    Assert.assertEquals(1536, mapValues[0]);
    verifyMapVmsToHostCalledMethods(rankedHosts, 3);
}