EvalHistogramData extends EvalData<EvalData> { @Override EvalData combine(EvalData data) { final EvalHistogramData value = (EvalHistogramData) data; return copyTo(EvalHistogramData.class, instance -> instance.buckets = Stream.concat(this.buckets.entrySet().stream(), value.buckets.entrySet().stream()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, Long::sum, TreeMap::new))); }  static EvalHistogramData build(MeterHistogram histogram, MeterProcessor processor); @Override EvalHistogramData irate(String range); @Override EvalHistogramData rate(String range); @Override EvalHistogramData increase(String range);  }
@Test public void testCombine() { assertHistogramOperation(EvalHistogramData::combine, operateHistogramData, 1, 20, 10, 30, 20, 6); }