Excellent article, and cheers for the professional attitude to drive correctness over "premature optimization"
But I wonder how this function works to calculate getDateBefore(date) without reference to the 'date' parameter??
One might expect to see: cal.setTime(date) before cal.add(...)