public Instant getEndOfNextNthPeriod(Instant instant, int periods) {
        return innerGetEndOfNextNthPeriod(this, this.periodicityType, instant, periods);
    }
@Test
    public void testVaryingNumberOfDailyPeriods() {
        RollingCalendar rc = new RollingCalendar("yyyy-MM-dd");
        final long MILLIS_IN_DAY = 24 * 3600 * 1000;

        for (int p = 20; p > -100; p--) {
            long now = 1223325293589L; // Mon Oct 06 22:34:53 CEST 2008
            Instant nowInstant = Instant.ofEpochMilli(now);
            Instant result = rc.getEndOfNextNthPeriod(nowInstant, p);
            long offset = rc.getTimeZone().getRawOffset() + rc.getTimeZone().getDSTSavings();

            long origin = now - ((now + offset) % (MILLIS_IN_DAY));
            long expected = origin + p * MILLIS_IN_DAY;
            assertEquals(expected, result.toEpochMilli(), "p=" + p);
        }
    }