Date nextWednesday = nextWednesday(fixingDate);
return fixingCalendar().advance(nextWednesday, 1, TimeUnit.Days);
}
private Date previousWednesday(final Date date) {
Weekday w = date.weekday();
if (w.value() >= 4) // roll back w-4 days
return date.subAssign((w.value() - 4));
else // roll forward 4-w days and back one week
return date.addAssign(4 - w.value() - 7);
}