public static boolean isAggregationCall(Expression expression) {
    return maybeCall(expression)
            .map(c -> AggregationOperators.isAggregation(c.operator()))
            .orElse(false);
  }
Assumes current expression is a {@link Constant}. Throws exception when it is not.
criteria/common/src/org/immutables/criteria/expression/Visitors.java