@Test
public void testGetEarliestStartDate()
{

    Period jan_2016 = PeriodType.getPeriodFromIsoString( "201601");
    Period feb_2016 = PeriodType.getPeriodFromIsoString( "201602");
    Period mar_2016 = PeriodType.getPeriodFromIsoString( "201603");
    Date dec_2015 = getDate( 2015, 12, 1 );
    DataQueryParams paramsA = DataQueryParams.newBuilder()
        .withStartDate( dec_2015 )
        .withPeriods( Lists.newArrayList( jan_2016 ) )
        .withFilterPeriods( Lists.newArrayList( feb_2016, mar_2016 ) )
        .build();
    DataQueryParams paramsB = DataQueryParams.newBuilder()
        .withStartDate( jan_2016.getStartDate() )
        .build();
    DataQueryParams paramsC = DataQueryParams.newBuilder()
        .withFilterPeriods( Lists.newArrayList( feb_2016, mar_2016 ) )
        .withPeriods( Lists.newArrayList( jan_2016 ) )
        .build();
    assertEquals( dec_2015, paramsA.getEarliestStartDate() );
    assertEquals( jan_2016.getStartDate(), paramsB.getEarliestStartDate() );
    assertEquals( jan_2016.getStartDate(), paramsC.getEarliestStartDate() );
}