@Test
public void normalizeIndex() {

    SlidingTimeWindowMovingAverages stwm = new SlidingTimeWindowMovingAverages();
    assertThat(stwm.normalizeIndex(0), is(0));
    assertThat(stwm.normalizeIndex(900), is(0));
    assertThat(stwm.normalizeIndex(9000), is(0));
    assertThat(stwm.normalizeIndex(-900), is(0));
    assertThat(stwm.normalizeIndex(1), is(1));
    assertThat(stwm.normalizeIndex(899), is(899));
    assertThat(stwm.normalizeIndex(-1), is(899));
    assertThat(stwm.normalizeIndex(-901), is(899));
}