@@ -0,0 +1,3237 @@
+package com.groupon.lex.metrics.timeseries;%0A%0Aimport java.util.Arrays;%0Aimport static java.util.Collections.unmodifiableList;%0Aimport java.util.List;%0Aimport org.joda.time.DateTime;%0Aimport org.joda.time.DateTimeZone;%0Aimport org.joda.time.Duration;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertSame;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport static org.mockito.Mockito.when;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class TimeSeriesCollectionPairTest %7B%0A    @Mock%0A    private TimeSeriesCollection t0, t1, t2;%0A    @Mock%0A    private TimeSeriesCollectionPair parent;%0A%0A    private static final DateTime TS0 = DateTime.now(DateTimeZone.UTC),%0A            TS1 = TS0.minus(Duration.standardMinutes(1)),%0A            TS2 = TS1.minus(Duration.standardMinutes(1));%0A%0A    private List%3CTimeSeriesCollection%3E list;%0A%0A    @Before%0A    public void setup() %7B%0A        list = unmodifiableList(Arrays.asList(t0, t1, t2));%0A%0A        when(t0.getTimestamp()).thenReturn(TS0);%0A        when(t1.getTimestamp()).thenReturn(TS1);%0A        when(t2.getTimestamp()).thenReturn(TS2);%0A    %7D%0A%0A    @Test%0A    public void getPreviousCollectionAtTest() %7B%0A        assertEquals(TS0, TimeSeriesCollectionPair.getPreviousCollectionAt(list, TS0).getTimestamp());%0A        assertEquals(TS1, TimeSeriesCollectionPair.getPreviousCollectionAt(list, TS1).getTimestamp());%0A        assertEquals(TS2, TimeSeriesCollectionPair.getPreviousCollectionAt(list, TS2).getTimestamp());%0A        assertEquals(TS0.minus(Duration.standardSeconds(30)), TimeSeriesCollectionPair.getPreviousCollectionAt(list, TS0.minus(Duration.standardSeconds(30))).getTimestamp());%0A        assertEquals(TS0.minus(Duration.standardDays(10)), TimeSeriesCollectionPair.getPreviousCollectionAt(list, TS0.minus(Duration.standardDays(10))).getTimestamp());%0A        assertEquals(TS0.plus(Duration.standardDays(10)), TimeSeriesCollectionPair.getPreviousCollectionAt(list, TS0.plus(Duration.standardDays(10))).getTimestamp());%0A    %7D%0A%0A    @Test%0A    public void getPreviousCollectionPairAtTest() %7B%0A        assertEquals(TS0, TimeSeriesCollectionPair.getPreviousCollectionPairAt(list, TS0, parent).getCurrentCollection().getTimestamp());%0A        assertEquals(TS1, TimeSeriesCollectionPair.getPreviousCollectionPairAt(list, TS1, parent).getCurrentCollection().getTimestamp());%0A        assertEquals(TS2, TimeSeriesCollectionPair.getPreviousCollectionPairAt(list, TS2, parent).getCurrentCollection().getTimestamp());%0A        assertEquals(TS0.minus(Duration.standardSeconds(30)), TimeSeriesCollectionPair.getPreviousCollectionPairAt(list, TS0.minus(Duration.standardSeconds(30)), parent).getCurrentCollection().getTimestamp());%0A        assertEquals(TS0.minus(Duration.standardDays(10)), TimeSeriesCollectionPair.getPreviousCollectionPairAt(list, TS0.minus(Duration.standardDays(10)), parent).getCurrentCollection().getTimestamp());%0A%0A        assertSame(t1, TimeSeriesCollectionPair.getPreviousCollectionPairAt(list, TS0, parent).getPreviousCollection());%0A        assertSame(t2, TimeSeriesCollectionPair.getPreviousCollectionPairAt(list, TS0, parent).getPreviousCollection(2).get());%0A    %7D%0A%7D%0A

Create tests for static methods in TimeSeriesCollectionPair.