@Test
public void next_moreThanTwoPeriodsSinceLastReading() {

    // :: Setup
    long now = 10_000;
    long period = 1_000;
    long grace = 5;
    int testCount = 0;
    // :: Act
    for (long last = now - 3 * grace; last >= now - 5 * period; last -= (grace * 3)) {
        long next = Anticipate.next(now, last, period, grace);
        // :: Verify
        assertWithMessage("last: " + last + " next is at least")
                .that(next)
                .isAtLeast(now + grace);
        assertWithMessage("last: " + last + " next is at most")
                .that(next)
                .isAtMost(now + period);
        long restOfWholePeriod = Math.abs((next - last) % period);
        if (restOfWholePeriod > period / 2) {
            restOfWholePeriod -= period;
        }
        assertWithMessage("last: " + last + " is around modulus grace")
                .that(restOfWholePeriod)
                .isAtMost(2 * grace);
        testCount++;
    }
    assertThat(testCount).isEqualTo(333);
}