TaskHelper { public static Date nextMonthStart(Date period) { Calendar cal = Calendar.getInstance(); cal.setTime(period); cal.add(Calendar.MONTH, 1); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTime(); }  static String join(double[] array, char separator); static String join(double[] array, char separator, int startIndex, int endIndex); static String join(int[] array, char separator); static String join(int[] array, char separator, int startIndex, int endIndex); static String join(Number[] array, char separator); static String join(Number[] array, char separator, int startIndex, int endIndex); static Date nextMonthStart(Date period); static Date thisHour(Date period); static Date todayZero(Date period); static Date tomorrowZero(Date period); static Date yesterdayZero(Date period);  }
@Test public void testNextMonthStart() { Assert.assertEquals(new Date(1554652800000L), TaskHelper.nextMonthStart(new Date(1552044153000L))); }