Vm { public double getCurrentRequestedTotalMips() { double totalRequestedMips = 0; for (double mips : getCurrentRequestedMips()) { totalRequestedMips += mips; } return totalRequestedMips; } Vm(
			int id,
			int userId,
			double mips,
			int numberOfPes,
			int ram,
			long bw,
			long size,
			String vmm,
			CloudletScheduler cloudletScheduler); double updateVmProcessing(double currentTime, List<Double> mipsShare); List<Double> getCurrentRequestedMips(); double getCurrentRequestedTotalMips(); double getCurrentRequestedMaxMips(); long getCurrentRequestedBw(); int getCurrentRequestedRam(); double getTotalUtilizationOfCpu(double time); double getTotalUtilizationOfCpuMips(double time); void setUid(String uid); String getUid(); static String getUid(int userId, int vmId); int getId(); int getUserId(); double getMips(); int getNumberOfPes(); int getRam(); void setRam(int ram); long getBw(); void setBw(long bw); long getSize(); void setSize(long size); String getVmm(); void setHost(Host host); Host getHost(); CloudletScheduler getCloudletScheduler(); boolean isInMigration(); void setInMigration(boolean inMigration); long getCurrentAllocatedSize(); int getCurrentAllocatedRam(); void setCurrentAllocatedRam(int currentAllocatedRam); long getCurrentAllocatedBw(); void setCurrentAllocatedBw(long currentAllocatedBw); List<Double> getCurrentAllocatedMips(); void setCurrentAllocatedMips(List<Double> currentAllocatedMips); boolean isBeingInstantiated(); void setBeingInstantiated(boolean beingInstantiated); List<VmStateHistoryEntry> getStateHistory(); void addStateHistoryEntry(
			double time,
			double allocatedMips,
			double requestedMips,
			boolean isInMigration); boolean isInPause(); void setInPause(boolean inPause);  }
@Test public void testGetCurrentRequestedTotalMips() { CloudletScheduler cloudletScheduler = createMock(CloudletScheduler.class); Vm vm = new Vm(ID, USER_ID, MIPS, PES_NUMBER, RAM, BW, SIZE, VMM, cloudletScheduler); ArrayList<Double> currentMips = new ArrayList<Double>(); currentMips.add(MIPS); currentMips.add(MIPS); expect(cloudletScheduler.getCurrentRequestedMips()).andReturn(currentMips); replay(cloudletScheduler); assertEquals(MIPS * 2, vm.getCurrentRequestedTotalMips(), 0); verify(cloudletScheduler); }