DateUtils { public static Date yearEnd() { final GregorianCalendar calendar = new GregorianCalendar(US); calendar.add(YEAR, 1); calendar.set(DAY_OF_YEAR, 1); calendar.add(DAY_OF_YEAR, -1); return calendar.getTime(); }  static Date today(); static Date yesterday(); static Date addDays(final int days, final Calendar from); static Date addDays(final int days, final Date from); static Date addDays(final int days, final long from); static Date addMonths(final int months, final Calendar from); static Date addMonths(final int months, final Date from); static Date addMonths(final int months, final long from); static Date addYears(final int years, final Calendar from); static Date addYears(final int years, final Date from); static Date addYears(final int years, final long from); static Date addWeeks(final int weeks, final Calendar from); static Date addWeeks(final int weeks, final Date from); static Date addWeeks(final int weeks, final long from); static Date yearStart(); static Date yearEnd();  }
@Test public void yearEnd() { Date date = DateUtils.yearEnd(); assertNotNull(date); GregorianCalendar calendar = new GregorianCalendar(); calendar.setTime(date); assertEquals(11, calendar.get(MONTH)); assertEquals(31, calendar.get(DAY_OF_MONTH)); }