### Question:
DeploymentPlan { public boolean canBeApplied() { return allHostsHaveEnoughResourcesForTheirAssignations(); } DeploymentPlan(List<VmAssignmentToHost> vmsAssignationsToHosts); boolean canBeApplied(); List<Vm> getVmsAssignedToHost(String hostname); void addVmAssignmentToPlan(VmAssignmentToHost vmAssignmentToHost); List<VmAssignmentToHost> getVmsAssignationsToHosts(); @Override String toString();  }### Answer:
@Test public void canBeAppliedReturnsTrueWhenPlanIsFeasible() { DeploymentPlan deploymentPlan = new DeploymentPlan(getAssignmentsList(new VmAssignmentToHost(vm1, host1), new VmAssignmentToHost(vm2, host2))); assertTrue(deploymentPlan.canBeApplied()); }
@Test public void canBeAppliedReturnsFalseWhenPlanIsNotFeasible() { DeploymentPlan deploymentPlan = new DeploymentPlan(getAssignmentsList(new VmAssignmentToHost(vm1, host1), new VmAssignmentToHost(vm2, host1))); assertFalse(deploymentPlan.canBeApplied()); }