public static Number[] applyFunction(short functorId, Number[] vals) {
    Number[] res = new Number[1];
    switch (functorId) {
      case FUN_SUM:
        res[0] = SUM(vals);
        return res;
      case FUN_AVG:
        res[0] = AVG(vals);
        return res;
      case FUN_MIN:
        res[0] = MIN(vals);
        return res;
      case FUN_MAX:
        res[0] = MAX(vals);
        return res;
      default:
        return null;
    }
  }
Apply the given function of the given list of numbers and returns result

@param functorId Id of function to be applied
@param vals List of number on which function will be applied
geode-core/src/main/java/org/apache/geode/internal/admin/statalerts/FunctionHelper.java