/*@Time*/ final double expected[] = new double[] { 1.0, 1.0, 1.0 };
// 1 years should be enough
final Date first = new Date(1,Month.January,2004);
final Date last = new Date(31,Month.December,2004);
final DayCounter dayCounter = new SimpleDayCounter();
for (final Date start = first; start.le(last); start.inc()) {
for (int i=0; i<expected.length-1; i++) {
final Date end = start.add(p[i]);
/*@Time*/ final double calculated = dayCounter.yearFraction(start, end);
if (abs(calculated-expected[i]) <= 1.0e-12) {
fail("from " + start + " to " + end + ":\n"
+ " calculated: " + calculated + "\n"
+ " expected: " + expected[i]);