@Test public void compare_sameGroupIdButdifferentPaths() { when(validator2.getGroupId()).thenReturn(GROUP1); assertTrue(comp.compare(validator1, validator2) < 0); assertTrue(comp.compare(validator2, validator1) > 0); }
@Override public int compare(AccessRightValidator o1, AccessRightValidator o2) { if (!o1.getGroupId().equals(o2.getGroupId())) { return o1.getGroupId().compareTo(o2.getGroupId()); } if (!o1.getResource().getPath().equals(o2.getResource().getPath())) { return o1.getResource().getPath().compareTo(o2.getResource().getPath()); } return o1.getLabel().compareTo(o2.getLabel()); }
AccessRightValidatorComparator implements Comparator<AccessRightValidator> { @Override public int compare(AccessRightValidator o1, AccessRightValidator o2) { if (!o1.getGroupId().equals(o2.getGroupId())) { return o1.getGroupId().compareTo(o2.getGroupId()); } if (!o1.getResource().getPath().equals(o2.getResource().getPath())) { return o1.getResource().getPath().compareTo(o2.getResource().getPath()); } return o1.getLabel().compareTo(o2.getLabel()); } }
AccessRightValidatorComparator implements Comparator<AccessRightValidator> { @Override public int compare(AccessRightValidator o1, AccessRightValidator o2) { if (!o1.getGroupId().equals(o2.getGroupId())) { return o1.getGroupId().compareTo(o2.getGroupId()); } if (!o1.getResource().getPath().equals(o2.getResource().getPath())) { return o1.getResource().getPath().compareTo(o2.getResource().getPath()); } return o1.getLabel().compareTo(o2.getLabel()); }  }
AccessRightValidatorComparator implements Comparator<AccessRightValidator> { @Override public int compare(AccessRightValidator o1, AccessRightValidator o2) { if (!o1.getGroupId().equals(o2.getGroupId())) { return o1.getGroupId().compareTo(o2.getGroupId()); } if (!o1.getResource().getPath().equals(o2.getResource().getPath())) { return o1.getResource().getPath().compareTo(o2.getResource().getPath()); } return o1.getLabel().compareTo(o2.getLabel()); }  @Override int compare(AccessRightValidator o1, AccessRightValidator o2); }
AccessRightValidatorComparator implements Comparator<AccessRightValidator> { @Override public int compare(AccessRightValidator o1, AccessRightValidator o2) { if (!o1.getGroupId().equals(o2.getGroupId())) { return o1.getGroupId().compareTo(o2.getGroupId()); } if (!o1.getResource().getPath().equals(o2.getResource().getPath())) { return o1.getResource().getPath().compareTo(o2.getResource().getPath()); } return o1.getLabel().compareTo(o2.getLabel()); }  @Override int compare(AccessRightValidator o1, AccessRightValidator o2);  }