CloudletToVmMappingSolution implements HeuristicSolution<Map<Cloudlet, Vm>> { @Override public Map<Cloudlet, Vm> getResult() { return Collections.unmodifiableMap(cloudletVmMap); } CloudletToVmMappingSolution(final Heuristic heuristic); private  CloudletToVmMappingSolution(final Heuristic heuristic, final Map<Cloudlet, Vm> cloudletVmMap);  CloudletToVmMappingSolution(final CloudletToVmMappingSolution solution); void bindCloudletToVm(final Cloudlet cloudlet, final Vm vm); @Override Heuristic<HeuristicSolution<Map<Cloudlet, Vm>>> getHeuristic(); @Override double getCost(); double getCost(final boolean forceRecompute); double getVmCost(final Map.Entry<Vm, List<Map.Entry<Cloudlet, Vm>>> entry); double getVmCost(final Vm vm, final List<Cloudlet> cloudlets); @Override int compareTo(final HeuristicSolution solution); @Override Map<Cloudlet, Vm> getResult(); static final double MIN_DIFF; }
@Test() public void testGetCloudletVmMapWhenModifyReadonlyMap() { final CloudletToVmMappingSolution instance = new CloudletToVmMappingSolution(Heuristic.NULL); final Map<Cloudlet, Vm> result = instance.getResult(); Assertions.assertThrows(UnsupportedOperationException.class, () -> result.put(Cloudlet.NULL, Vm.NULL)); }
@Test public void testGetCloudletVmMapWhenNotNullMap() { final CloudletToVmMappingSolution instance = new CloudletToVmMappingSolution(Heuristic.NULL); assertNotNull(instance.getResult()); }