### Question:
SchedAlgRandom implements SchedAlgorithm { @Override public DeploymentPlan chooseBestDeploymentPlan(List<DeploymentPlan> deploymentPlans, List<Host> hosts, String deploymentId) { DeploymentPlan bestDeploymentPlan = null; double bestDeploymentPlanScore = -1; for (DeploymentPlan deploymentPlan: deploymentPlans) { double deploymentPlanScore = Math.random(); VMMLogger.logDeploymentPlanRandomScore(deploymentPlan, deploymentPlanScore, deploymentId); if (deploymentPlanScore > bestDeploymentPlanScore) { bestDeploymentPlan = deploymentPlan; bestDeploymentPlanScore = deploymentPlanScore; } } return bestDeploymentPlan; } SchedAlgRandom(); @Override DeploymentPlan chooseBestDeploymentPlan(List<DeploymentPlan> deploymentPlans, List<Host> hosts,
            String deploymentId); @Override SchedAlgorithmNameEnum getNameEnum();  }### Answer:
@Test public void isBetterDeploymentPlan() { List<Vm> vms = new ArrayList<>(); vms.add(new Vm("vm1", "image", 2, 2048, 2, null, "")); vms.add(new Vm("vm2", "image", 1, 1024, 1, null, "")); List<Host> hosts = new ArrayList<>(); hosts.add(new HostFake("host1", 8, 8192, 8, 1, 1024, 1)); hosts.add(new HostFake("host2", 4, 4096, 4, 1, 1024, 1)); List<VmAssignmentToHost> assignmentsPlan1 = new ArrayList<>(); assignmentsPlan1.add(new VmAssignmentToHost(vms.get(0), hosts.get(0))); assignmentsPlan1.add(new VmAssignmentToHost(vms.get(1), hosts.get(1))); DeploymentPlan deploymentPlan1 = new DeploymentPlan(assignmentsPlan1); List<VmAssignmentToHost> assignmentsPlan2 = new ArrayList<>(); assignmentsPlan2.add(new VmAssignmentToHost(vms.get(0), hosts.get(1))); assignmentsPlan2.add(new VmAssignmentToHost(vms.get(1), hosts.get(0))); DeploymentPlan deploymentPlan2 = new DeploymentPlan(assignmentsPlan2); List<DeploymentPlan> deploymentPlans = new ArrayList<>(); deploymentPlans.add(deploymentPlan1); deploymentPlans.add(deploymentPlan2); scheduler.chooseBestDeploymentPlan(deploymentPlans, hosts, "testId"); }