    @Test
    public void testGetNextStartTimeFor() {

        long now = DateTime.parse("2015-03-21T14:12:00").getMillis();//2:12pm
        DateTimeUtils.setCurrentMillisFixed(now);

        //before interval is interval start when start < end

        long start = parseTime("15:12"); //3:12pm
        long end = parseTime("16:12");//4:12pm

        assertThat(getNextNextStartTimeFor(start, end)).isEqualTo(DateTime.parse("2015-03-21T15:12:00").getMillis());

        //inside interval rolls next day when start < end

        start = parseTime("13:12"); //1:12pm
        end = parseTime("16:12");//4:12pm

        assertThat(getNextNextStartTimeFor(start, end)).isEqualTo(DateTime.parse("2015-03-22T13:12:00").getMillis());

        //after interval rolls next day when start < end

        start = parseTime("10:12"); //10:12am
        end = parseTime("13:12");//1:12pm

        assertThat(getNextNextStartTimeFor(start, end)).isEqualTo(DateTime.parse("2015-03-22T10:12:00").getMillis());

        //inside interval rolls next day when start > end

        start = parseTime("13:12"); //1:12pm
        end = parseTime("12:12");//12:12pm

        assertThat(getNextNextStartTimeFor(start, end)).isEqualTo(DateTime.parse("2015-03-22T13:12:00").getMillis());

        //outside interval is same day when start > end

        start = parseTime("15:12"); //3:12pm
        end = parseTime("10:12");//10:12am

        assertThat(getNextNextStartTimeFor(start, end)).isEqualTo(DateTime.parse("2015-03-21T15:12:00").getMillis());
    }