### Question:
Cron { public Date next(Date date) { Calendar calendar = new GregorianCalendar(); calendar.setTime(date); calendar.add(Calendar.SECOND, 1); calendar.set(Calendar.MILLISECOND, 0); next0(calendar); return calendar.getTime(); } private  Cron(String expression); static Cron compile(String cronExpression); boolean matches(Date date); Date next(Date date); String getExpression(); Field[] getFields(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test(dataProvider = "nexts") public void testNext(String cronExpression, String dateString, String nextDateString) throws ParseException { Cron cron = Cron.compile(cronExpression); Date nextDate = cron.next(DF.parse(dateString)); Assert.assertEquals(DF.format(nextDate), nextDateString); }