ActualNL extends ActualTypeDayCount { @Override public double getDayCountFraction(final LocalDate firstDate, final LocalDate secondDate) { testDates(firstDate, secondDate); long actualDays = secondDate.toEpochDay() - firstDate.toEpochDay(); int numberOfLeapDays = 0; LocalDate temp = nextLeapDay(firstDate); while (temp.isAfter(secondDate) == false) { numberOfLeapDays++; temp = nextLeapDay(temp); } return (actualDays - numberOfLeapDays) / 365d; }  @Override double getAccruedInterest(final LocalDate previousCouponDate, final LocalDate date, final LocalDate nextCouponDate, final double coupon, final double paymentsPerYear); @Override double getDayCountFraction(final LocalDate firstDate, final LocalDate secondDate); @Override String getName();  }
@Test(dataProvider = "nl365") public void testDifferentYearLeapDays2(LocalDate start, LocalDate end, double expected) { assertEquals(ACTUAL_NL.getDayCountFraction(start, end), expected, EPS); }