@Test
public void testSetAvgMetrics() {

  taskMonitor.setAvgMetrics(TaskMonitor.AVG_GPU_FB_MEMORY_USAGE_INDEX, 0.1);
  taskMonitor.numRefreshes++;
  taskMonitor.setAvgMetrics(TaskMonitor.AVG_GPU_FB_MEMORY_USAGE_INDEX, 0.3);
  taskMonitor.numRefreshes++;
  taskMonitor.setAvgMetrics(TaskMonitor.AVG_GPU_FB_MEMORY_USAGE_INDEX, 0.5);
  MetricsWritable metrics = taskMonitor.getMetrics();
  Assert.assertEquals(metrics.getMetric(TaskMonitor.AVG_GPU_FB_MEMORY_USAGE_INDEX).getValue(), 0.3);
}