@Test
public void testSetMaxMetrics() {

  taskMonitor.setMaxMetrics(TaskMonitor.AVG_GPU_FB_MEMORY_USAGE_INDEX, 0.1);
  taskMonitor.numRefreshes++;
  taskMonitor.setMaxMetrics(TaskMonitor.AVG_GPU_FB_MEMORY_USAGE_INDEX, 0.4);
  taskMonitor.numRefreshes++;
  taskMonitor.setMaxMetrics(TaskMonitor.AVG_GPU_FB_MEMORY_USAGE_INDEX, 0.2);
  MetricsWritable metrics = taskMonitor.getMetrics();
  Assert.assertEquals(metrics.getMetric(TaskMonitor.AVG_GPU_FB_MEMORY_USAGE_INDEX).getValue(), 0.4);
}