@Test public void selectHostsToBeTurnedOnGivenMinMax() { List<Host> candidateHosts = new ArrayList<>(); candidateHosts.add(new Host("host1", 5, 1024, 1, 0, 0, 0, false)); candidateHosts.add(new Host("host2", 10, 1024, 1, 0, 0, 0, false)); candidateHosts.add(new Host("host3", 15, 1024, 1, 0, 0, 0, false)); List<Host> selectedHosts = randomHostSelector.selectHostsToBeTurnedOn(candidateHosts, 2, 7); assertEquals(1, selectedHosts.size()); assertEquals("host1", selectedHosts.get(0).getHostname()); }
@Override public List<Host> selectHostsToBeTurnedOn(List<Host> candidateHosts, int nHosts) { return selectHosts(candidateHosts, nHosts); }
RandomHostSelector implements HostSelector { @Override public List<Host> selectHostsToBeTurnedOn(List<Host> candidateHosts, int nHosts) { return selectHosts(candidateHosts, nHosts); } }
RandomHostSelector implements HostSelector { @Override public List<Host> selectHostsToBeTurnedOn(List<Host> candidateHosts, int nHosts) { return selectHosts(candidateHosts, nHosts); }  }
RandomHostSelector implements HostSelector { @Override public List<Host> selectHostsToBeTurnedOn(List<Host> candidateHosts, int nHosts) { return selectHosts(candidateHosts, nHosts); }  @Override List<Host> selectHostsToBeTurnedOn(List<Host> candidateHosts, int nHosts); @Override List<Host> selectHostsToBeTurnedOn(List<Host> candidateHosts, int minCpus, int maxCpus); @Override List<Host> selectHostsToBeTurnedOff(List<Host> candidateHosts, int nHosts); @Override List<Host> selectHostsToBeTurnedOff(List<Host> candidateHosts, int minCpus, int maxCpus); }
RandomHostSelector implements HostSelector { @Override public List<Host> selectHostsToBeTurnedOn(List<Host> candidateHosts, int nHosts) { return selectHosts(candidateHosts, nHosts); }  @Override List<Host> selectHostsToBeTurnedOn(List<Host> candidateHosts, int nHosts); @Override List<Host> selectHostsToBeTurnedOn(List<Host> candidateHosts, int minCpus, int maxCpus); @Override List<Host> selectHostsToBeTurnedOff(List<Host> candidateHosts, int nHosts); @Override List<Host> selectHostsToBeTurnedOff(List<Host> candidateHosts, int minCpus, int maxCpus);  }