@Override
  public Object terminate() {
    double sum = 0;
    for (Object o : distinct) {
      sum += ((Number) o).doubleValue();
    }

    return downCast(sum);
  }
Computes the sum of distinct values for replicated region based queries.
geode-core/src/main/java/org/apache/geode/cache/query/internal/aggregate/SumDistinct.java