FlatDayCount extends StatelessDayCount { @Override public double getDayCountFraction(final LocalDate firstDate, final LocalDate secondDate) { throw new NotImplementedException("Cannot get day count fraction for a flat day count"); }  @Override double getDayCountFraction(final LocalDate firstDate, final LocalDate secondDate); @Override double getAccruedInterest(final LocalDate previousCouponDate, final LocalDate date, final LocalDate nextCouponDate, final double coupon, final double paymentsPerYear); @Override String getName();  }
@Test(expectedExceptions = NotImplementedException.class) public void testYearFraction() { DC.getDayCountFraction(D1, D2); }