code: public Object getResult(AverageData data) {
          return data.count == 0 ? BigDecimal.ZERO : data.total.divide(BigDecimal.valueOf( data.count ), RoundingMode.HALF_EVEN );
      }
docs: /* (non-Javadoc)
  @see org.kie.base.accumulators.AccumulateFunction#getResult(java.lang.Object)