@Test
public void testPointCountRounded() {

    //We allow some imprecision to simplify calendar dates
    assertEquals(3, new RegularTimeSeriesIndex(0, 19, 10).getPointCount());
    assertEquals(3, new RegularTimeSeriesIndex(0, 20, 10).getPointCount());
    assertEquals(3, new RegularTimeSeriesIndex(0, 21, 10).getPointCount());
    //Concrete example:
    // 1 data every year for 10 years (rounding hides the year length differences):
    // millisInYear is not exact because of leap years, but even when taking leap years into account,
    // the number of seconds in a year in not predictable because of leap seconds.
    // Still it's a good enough approximation give the correct result.
    long millisInYear = 365L * 86400 * 1000;
    assertEquals(10, new RegularTimeSeriesIndex(
        Instant.parse("2000-01-01T00:00:00Z").toEpochMilli(),
        Instant.parse("2009-01-01T00:00:00Z").toEpochMilli(),
        millisInYear).getPointCount());
}