### Question:
ValidatorMain { static Date getEarliestDate(Optional<Date> o, Date d){ if (o.isPresent()){ d = o.get().before(d) ? o.get() : d; } return d; }  static void main(String[] args); static String getValidationSummary(ValidationResult result); static String getValidationReport(ValidationResult result); static String SILENT_MODE; }### Answer:
@Test public void testEarlier() { Optional<Date> o = Optional.of(new Date(0L)); Date d = new Date(100000L); Date returned = ValidatorMain.getEarliestDate(o, d); assertSame(o.get(), returned); }
@Test public void testEarlier2() { Optional<Date> o = Optional.of(new Date(10L)); Date d = new Date(0L); Date returned = ValidatorMain.getEarliestDate(o, d); assertSame(d, returned); }