Measurement measurement = new Measurement();
MeasurableProperty property = new MeasurableProperty();
String propertyName = m.getProperty().getName();
property.setName(propertyName+":accumulated:average");
FloatScale scale = new FloatScale();
property.setScale(scale);
measurement.setProperty(property);
scale.setUnit(""+list.size());
Double d = 0.0;
for (Measurement entry : list) {
INumericValue value = (INumericValue) entry.getValue();
d+= value.value();
}
FloatValue average = (FloatValue) new FloatScale().createValue();
average.setValue(d/list.size());
measurement.setValue(average);
return measurement;
}