/***
 * Excerpted from "Domain-Driven Design Using Naked Objects",
 * published by The Pragmatic Bookshelf.
 * Copyrights apply to this code. It may not be used to create training material, 
 * courses, books, articles, and the like. Contact us if you are in doubt.
 * We make no guarantees that this code is fit for any purpose. 
 * Visit http://www.pragmaticprogrammer.com/titles/dhnako for more book information.
***/
@Override
public DefaultsProvider<CalendarInterval> getDefaultsProvider() {
    return new DefaultsProvider<CalendarInterval>() {
        public CalendarInterval getDefaultValue() {
            CalendarDate start = CalendarDate.from(
                    todayPlus(1).toString(), "yyyy-MM-dd");
            return CalendarInterval.startingFrom(
                    start, Duration.days(1));
        }
        private static final long MILLIS_PER_DAY = 24 * 60 * 60 * 1000;
        private Date todayPlus(final int days) {
            Date midnight = new Date(Clock.getTime());
            return new Date(midnight.getTime() + MILLIS_PER_DAY * days); 
        }
    };
}
