public List<Long> availableWindows() {
    return getWindowList(_oldestWindowIndex, _currentWindowIndex - 1);
  }
@Test
  public void testAvailableWindows() {
    MetricSampleAggregator<String, IntegerEntity> aggregator =
        new MetricSampleAggregator<>(NUM_WINDOWS, WINDOW_MS, MIN_SAMPLES_PER_WINDOW,
                                     0, _metricDef);
    assertTrue(aggregator.availableWindows().isEmpty());
    CruiseControlUnitTestUtils.populateSampleAggregator(1, MIN_SAMPLES_PER_WINDOW, aggregator,
                                                        ENTITY1, 0, WINDOW_MS, _metricDef);
    assertTrue(aggregator.availableWindows().isEmpty());
    CruiseControlUnitTestUtils.populateSampleAggregator(NUM_WINDOWS - 2, MIN_SAMPLES_PER_WINDOW, aggregator,
                                                        ENTITY1, 1, WINDOW_MS, _metricDef);
    List<Long> availableWindows = aggregator.availableWindows();
    assertEquals(NUM_WINDOWS - 2, availableWindows.size());
    for (int i = 0; i < NUM_WINDOWS - 2; i++) {
      assertEquals((i + 1) * WINDOW_MS, availableWindows.get(i).longValue());
    }
  }