@Test
  public void testTimedAverageMetricsChanging() {
    TimedAverageMetrics metrics;

    metrics = generateTimedAverageMetrics(3, 30, 6, 0, 10, 0, 10);
    assertEquals("Position 0", 40, metrics.value(60));

    metrics = generateTimedAverageMetrics(3, 30, 5, 0, 10, 0, 10);
    assertEquals("Position windowDataSize - 1", 30, metrics.value(50));
  }
Test TimedAverageMetrics with changing data to see that we handle array edge cases correctly.
llap-server/src/test/org/apache/hadoop/hive/llap/metrics/TestLlapDaemonExecutorMetrics.java