protected int evaluateSortCriteria(Object value1, Object value2) {
    int result = -1;
    if (orderByAttrs != null) {
      for (CompiledSortCriterion csc : orderByAttrs) {
        Object sortCriteriaForValue1 = csc.evaluate(value1, context);
        Object sortCriteriaForValue2 = csc.evaluate(value2, context);
        result = compareHelperMethod(sortCriteriaForValue1, sortCriteriaForValue2);
        if (result != 0) {
          if (csc.getCriterion()) {
            result *= -1;
          }
          break;
        }
      }
    }
    return result;
  }
This method evaluates sort criteria and returns the resulting integer value of comparing the
two objects passed into it based on these criteria.

@param value1 the first object to be compared.
@param value2 the second object to be compared.
@return a negative integer, zero, or a positive integer if the first argument is less than,
        equal to, or greater than the second, based on the evaluated sort criteria.
geode-core/src/main/java/org/apache/geode/cache/query/internal/OrderByComparator.java