@Test
public void testRateCalculationOnMetricsWithEqualValues() throws Exception {

  Map<Long, Double> metricValues = new TreeMap<>();
  metricValues.put(1454016368371L, 1011.25);
  metricValues.put(1454016428371L, 1011.25);
  metricValues.put(1454016488371L, 1011.25);
  metricValues.put(1454016548371L, 1011.25);
  metricValues.put(1454016608371L, 1011.25);
  metricValues.put(1454016668371L, 1011.25);
  metricValues.put(1454016728371L, 1011.25);
  // Calculate rate
  Map<Long, Double> rates = HBaseTimelineMetricStore.updateValuesAsRate(new TreeMap<>(metricValues), false);
  // Make sure rate is zero
  for (Map.Entry<Long, Double> rateEntry : rates.entrySet()) {
    Assert.assertEquals("Rate should be zero, key = " + rateEntry.getKey()
        + ", value = " + rateEntry.getValue(), 0.0, rateEntry.getValue());
  }
}