XenHypervisor implements HypervisorHost { protected boolean isLastHostOnPool(Connection conn) throws BadServerResponse, XenAPIException, XmlRpcException { return Host.getAll(conn).size() == 1; }  @Override void shutdownHost(HostVO hostVo); @Override boolean supportsHypervisor(HypervisorType hypervisorType);  }
@Test public void isLastHostOnPoolTest() throws Exception { Set<Host> setHosts = new HashSet<Host>(); setHosts.add(host); setIsLastHostOnPool(setHosts); boolean result = xenHypervisor.isLastHostOnPool(conn); Assert.assertTrue(result); }
@Test public void isLastHostOnPoolTestEmptySet() throws Exception { Set<Host> setHosts = new HashSet<Host>(); setIsLastHostOnPool(setHosts); boolean result = xenHypervisor.isLastHostOnPool(conn); Assert.assertFalse(result); }