class SumDistinct extends DistinctAggregator {

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

    return downCast(sum);
  }

}