VcResourceUtils { public static List<VcHost> findAllHostInVcResourcePool( final String vcClusterName, final String vcRpName) { Set<VcHost> vcHosts = new HashSet<>(); VcResourcePool vcResourcePool = findRPInVCCluster(vcClusterName, vcRpName); collectVcHostFromVcRps(vcHosts, vcResourcePool); List<VcHost> hosts = new ArrayList<>(); hosts.addAll(vcHosts); return hosts; }  static Collection<VcDatastore> findDSInVCByPattern(
         final String vcDSNamePattern); static VcDatastore findDSInVcByName(String dsName); static VcNetwork findNetworkInVC(final String portGroupName); static List<VcHost> findAllHostInVcResourcePool(
         final String vcClusterName, final String vcRpName); static List<VcHost> findAllHostsInVCCluster(final String clusterName); static VcHost findHost(final String hostName); static VcCluster findVcCluster(final String clusterName); static VcResourcePool findRPInVCCluster(final String clusterName,
         final String vcRPName); static VcVirtualMachine findVmInVcCluster(String vcClusterName,
         String rpName, String vmName); static Folder findParentFolderOfVm(final VcVirtualMachine serverVm); static List<VcVirtualMachine> findAllTemplateVmsWithinFolder(final Folder parentFolder); static VcVirtualMachine findTemplateVmWithinFolder(
         final Folder parentFolder, final String templateVmName); static Folder findFolderByNameList(final VcDatacenter dc,
         final List<String> folderNames); static Folder findFolderByName(final Folder folder,
         final String folderName); static boolean isObjectInFolder(final Folder folder,
         final String mobId); static VcVirtualMachine findNodeTemplateByName(String name); static List<VcVirtualMachine> findAllNodeTemplates(); static VcVirtualMachine findVmInRp(final VcResourcePool rp,
         final String vmName); static void refreshDatastore(final VcCluster cl); static void refreshVcResources(); static void refreshResourcePool(final VcCluster cl); static void refreshNetwork(final VcCluster cl); static boolean insidedRootFolder(final Folder rootFolder,
         final VcVirtualMachine vm); static void checkVmFTAndCpuNumber(final String vmId, final String vmName,
         final int cpuNumber); static void checkVmMaxConfiguration(final String vmId,
         final int cpuNumber, final long memory); static int getHostTimeDiffInSec(final String hostName); static String getManagementServerHost(); static VcVirtualMachine findVM(final String moid); static String getServerMobId(); static VcVirtualMachine findServerVM(); static VcVirtualMachine findServerVM(final String serverMobId); static VcResourcePool getVmRp(final VcVirtualMachine serverVm); static VcCluster getRpCluster(final VcResourcePool vcRp); static Map<DatastoreType, List<String>> getVmDatastore(
         final VcVirtualMachine serverVm); static String getVMNetwork(final VcVirtualMachine serverVm); static synchronized VcDatacenter getCurrentDatacenter(); static synchronized String getCurrentDatacenterName(); static List<VcCluster> getClusters();  }
@Test(groups = {"TestVcResourceUtils"}) public void testFindAllHostInVcResourcePool() { List<VcHost> host = VcResourceUtils.findAllHostInVcResourcePool("cluster1", "rp1"); Assert.assertEquals(host.size(), 1); host = VcResourceUtils.findAllHostInVcResourcePool("cluster2", "rp2"); Assert.assertEquals(host.size(), 0); }