### Question:
DateUtil { public static Date getCeilDate(Date date, UpdatePeriod interval) { return interval.getCeilDate(date); } private  DateUtil(); static String getAbsDateFormatString(String str); static Date resolveDate(String str, Date now); static String relativeToAbsolute(String relative); static String relativeToAbsolute(String relative, Date now); static String formatAbsDate(Date date); static Date resolveAbsoluteDate(final String str); static Date resolveRelativeDate(String str, Date now); static Date getCeilDate(Date date, UpdatePeriod interval); static Date getFloorDate(Date date, UpdatePeriod interval); static CoveringInfo getMonthlyCoveringInfo(Date from, Date to); static CoveringInfo getQuarterlyCoveringInfo(Date from, Date to); static CoveringInfo getYearlyCoveringInfo(Date from, Date to); static CoveringInfo getWeeklyCoveringInfo(Date from, Date to); static int getTimeDiff(Date fromDate, Date toDate, UpdatePeriod updatePeriod); static final String UNIT; static final Date MAX_DATE; static final Date MIN_DATE; static final String GRANULARITY; static final String RELATIVE; static final Pattern P_RELATIVE; static final String WSPACE; static final String OPTIONAL_WSPACE; static final String SIGNAGE; static final Pattern P_SIGNAGE; static final String QUANTITY; static final Pattern P_QUANTITY; static final Pattern P_UNIT; static final String RELDATE_VALIDATOR_STR; static final Pattern RELDATE_VALIDATOR; static final Pattern TIMESTAMP_VALIDATOR; static final String YEAR_FMT; static final String MONTH_FMT; static final String DAY_FMT; static final String HOUR_FMT; static final String MINUTE_FMT; static final String SECOND_FMT; static final String MILLISECOND_FMT; static final String ABSDATE_FMT; static final String HIVE_QUERY_DATE_FMT; static final ThreadLocal<DateFormat> ABSDATE_PARSER; static final ThreadLocal<DateFormat> HIVE_QUERY_DATE_PARSER; }### Answer:
@Test public void testCeilDate() throws ParseException { Date date = ABSDATE_PARSER.get().parse("2015-12-26-06:30:15,040"); assertEquals(getCeilDate(date, YEARLY), ABSDATE_PARSER.get().parse("2016-01-01-00:00:00,000")); assertEquals(getCeilDate(date, MONTHLY), ABSDATE_PARSER.get().parse("2016-01-01-00:00:00,000")); assertEquals(getCeilDate(date, DAILY), ABSDATE_PARSER.get().parse("2015-12-27-00:00:00,000")); assertEquals(getCeilDate(date, HOURLY), ABSDATE_PARSER.get().parse("2015-12-26-07:00:00,000")); assertEquals(getCeilDate(date, MINUTELY), ABSDATE_PARSER.get().parse("2015-12-26-06:31:00,000")); assertEquals(getCeilDate(date, SECONDLY), ABSDATE_PARSER.get().parse("2015-12-26-06:30:16,000")); assertEquals(getCeilDate(date, WEEKLY), ABSDATE_PARSER.get().parse("2015-12-27-00:00:00,000")); }