@Test public void test_compose() throws Exception { assertEquals(20140912, compose(2014, 9, 12)); assertEquals(20141212, compose(2014, 12, 12)); assertEquals(20150112, compose(2014, 13, 12)); assertEquals(20140912, compose(2013, 9, 12 + 365)); assertEquals(20140912, compose(2015, 9, 12 - 365)); assertEquals(20150912, compose(2016, 9, 12 - 366)); assertEquals(20141201, compose(2014, 12, 1)); assertEquals(20151102, compose(2015, 11, 2)); }
public static int compose(int year, int month, int day) { return addDays(addMonths(year * 10000, month), day); }
Dint { public static int compose(int year, int month, int day) { return addDays(addMonths(year * 10000, month), day); } }
Dint { public static int compose(int year, int month, int day) { return addDays(addMonths(year * 10000, month), day); }  }
Dint { public static int compose(int year, int month, int day) { return addDays(addMonths(year * 10000, month), day); }  static int create(int year, int month, int day); static int create(Calendar calendar); static int create(Date date); static int compose(int year, int month, int day); static int year(int dint); static int month(int dint); static int day(int dint); static Calendar toCalendar(int dint); static Date toDate(int dint); static int today(); static int firstDayOfMonth(int dint); static int lastDayOfMonth(int dint); static int daysInAMonth(int year, int month); static boolean isLeapYear(int year); static int diff(int dint1, int dint2); static int addYears(int dint, int years); static int addYearsExtend(int dint, int years); static int addMonths(int dint, int add); static int addMonthsExtend(int dint, int add); static int addDays(int dint, int days); }
Dint { public static int compose(int year, int month, int day) { return addDays(addMonths(year * 10000, month), day); }  static int create(int year, int month, int day); static int create(Calendar calendar); static int create(Date date); static int compose(int year, int month, int day); static int year(int dint); static int month(int dint); static int day(int dint); static Calendar toCalendar(int dint); static Date toDate(int dint); static int today(); static int firstDayOfMonth(int dint); static int lastDayOfMonth(int dint); static int daysInAMonth(int year, int month); static boolean isLeapYear(int year); static int diff(int dint1, int dint2); static int addYears(int dint, int years); static int addYearsExtend(int dint, int years); static int addMonths(int dint, int add); static int addMonthsExtend(int dint, int add); static int addDays(int dint, int days);  }