*/
protected int compareProperty(Object propertyId, boolean sortDirection,
Item item1, Item item2) {
// Get the properties to compare
final Property property1 = item1.getItemProperty(propertyId);
final Property property2 = item2.getItemProperty(propertyId);
// Get the values to compare
final Object value1 = (property1 == null) ? null : property1.getValue();
final Object value2 = (property2 == null) ? null : property2.getValue();
// Result of the comparison
int r = 0;
if (sortDirection) {
r = propertyValueComparator.compare(value1, value2);