Host { public void vmDestroy(Vm vm) { if (vm != null) { vmDeallocate(vm); getVmList().remove(vm); vm.setHost(null); } } Host(
			int id,
			RamProvisioner ramProvisioner,
			BwProvisioner bwProvisioner,
			long storage,
			List<? extends Pe> peList,
			VmScheduler vmScheduler); double updateVmsProcessing(double currentTime); void addMigratingInVm(Vm vm); void removeMigratingInVm(Vm vm); void reallocateMigratingInVms(); boolean isSuitableForVm(Vm vm); boolean vmCreate(Vm vm); void vmDestroy(Vm vm); void vmDestroyAll(); Vm getVm(int vmId, int userId); int getNumberOfPes(); int getNumberOfFreePes(); int getTotalMips(); boolean allocatePesForVm(Vm vm, List<Double> mipsShare); void deallocatePesForVm(Vm vm); List<Double> getAllocatedMipsForVm(Vm vm); double getTotalAllocatedMipsForVm(Vm vm); double getMaxAvailableMips(); double getAvailableMips(); long getBw(); int getRam(); long getStorage(); int getId(); RamProvisioner getRamProvisioner(); BwProvisioner getBwProvisioner(); VmScheduler getVmScheduler(); @SuppressWarnings("unchecked") List<T> getPeList(); @SuppressWarnings("unchecked") List<T> getVmList(); boolean isFailed(); boolean setFailed(String resName, boolean failed); boolean setFailed(boolean failed); boolean setPeStatus(int peId, int status); List<Vm> getVmsMigratingIn(); Datacenter getDatacenter(); void setDatacenter(Datacenter datacenter);  }
@Test public void testVmDestroy() { Vm vm = new Vm(0, 0, MIPS, 1, RAM / 2, BW / 2, 0, "", new CloudletSchedulerDynamicWorkload(MIPS, 1)); assertTrue(host.vmCreate(vm)); assertSame(vm, host.getVm(0, 0)); assertEquals(MIPS, host.getVmScheduler().getAvailableMips(), 0); host.vmDestroy(vm); assertNull(host.getVm(0, 0)); assertEquals(0, host.getVmList().size()); assertEquals(MIPS * 2, host.getVmScheduler().getAvailableMips(), 0); }