class AbstractAggregator implements Aggregator {

  public static Number downCast(long value) {
    Number retVal;

    if (value <= Integer.MAX_VALUE && value >= Integer.MIN_VALUE) {
      retVal = Integer.valueOf((int) value);
    } else {
      retVal = value;
    }

    return retVal;
  }

}