### Question:
VmDifficultyComparator implements Comparator<Vm>, Serializable { @Override public int compare(Vm vm1, Vm vm2) { return Double.compare(difficulty(vm1), difficulty(vm2)); }  @Override int compare(Vm vm1, Vm vm2);  }### Answer:
@Test public void comparisonShouldReturnPositiveWhenFirstVmMoreDifficult() { assertTrue(vmDifficultyComparator.compare( new Vm.Builder((long) 1, 2, 1, 1).build(), new Vm.Builder((long) 2, 1, 1, 1).build()) > 0); }
@Test public void comparisonShouldReturnZeroWhenVmsEquallyDifficult() { assertTrue(vmDifficultyComparator.compare( new Vm.Builder((long) 1, 2, 1, 1).build(), new Vm.Builder((long) 2, 2, 1, 1).build()) == 0); }
@Test public void comparisonShouldReturnNegativeWhenFirstVmLessDifficult() { assertTrue(vmDifficultyComparator.compare( new Vm.Builder((long) 1, 1, 1, 1).build(), new Vm.Builder((long) 2, 2, 1, 1).build()) < 0); }