### Question:
DenialConstraintResultComparator extends ResultComparator<DenialConstraintResult> { @Override protected int compare(DenialConstraintResult o1, DenialConstraintResult o2, String sortProperty) { switch(sortProperty) { case PREDICATES: return o1.getResult().toString().compareTo(o2.getResult().toString()); case SIZE: return Integer.compare(o1.getResult().getPredicateCount(), o2.getResult().getPredicateCount()); } return 0; } DenialConstraintResultComparator(String sortProperty, boolean isAscending);  static final String PREDICATES; static final String SIZE; }### Answer:
@Test public void compare1() { DenialConstraintResultComparator resultComparator = new DenialConstraintResultComparator( DenialConstraintResultComparator.PREDICATES, true); assertTrue(resultComparator.compare(dc1, dc2) > 0); }
@Test public void compare2() { DenialConstraintResultComparator resultComparator = new DenialConstraintResultComparator( DenialConstraintResultComparator.PREDICATES, false); assertTrue(resultComparator.compare(dc1, dc2) < 0); }
@Test public void compare3() { DenialConstraintResultComparator resultComparator = new DenialConstraintResultComparator( DenialConstraintResultComparator.SIZE, true); assertTrue(resultComparator.compare(dc1, dc2) > 0); }
@Test public void compare4() { DenialConstraintResultComparator resultComparator = new DenialConstraintResultComparator( DenialConstraintResultComparator.SIZE, false); assertTrue(resultComparator.compare(dc1, dc2) < 0); }