### Question:
DefectService { boolean areEqualDownToSeconds(Date date1, Date date2) { final boolean bothNull = (date1 == null && date2 == null); final boolean bothNotNull = (date1 != null && date2 != null); return bothNull || (bothNotNull && (date1.getTime() / 1000) == (date2.getTime() / 1000)); }  Optional<DefectAdapter> getAdapter(long projectId); List<DefectAdapter> getAdapters(); @Scheduled(fixedDelayString = "${ara.defectSyncSchedulingDelayInMilliseconds}", initialDelayString = "${ara.defectSyncSchedulingInitialDelayInMilliseconds}") @Transactional void updateStatuses(); @Transactional void fullIndex(Project project, DefectAdapter defectAdapter); @Transactional void incrementalIndex(Project project, DefectAdapter defectAdapter, Date since); @Transactional void refreshDefectExistences(long projectId);  }### Answer:
@Test public void areEqualDownToSeconds_should_return_true_for_two_null_dates() { boolean areEqual = cut.areEqualDownToSeconds(null, null); assertThat(areEqual).isTrue(); }
@Test public void areEqualDownToSeconds_should_return_false_for_first_date_null() { boolean areEqual = cut.areEqualDownToSeconds(null, new Date()); assertThat(areEqual).isFalse(); }
@Test public void areEqualDownToSeconds_should_return_false_for_second_date_null() { boolean areEqual = cut.areEqualDownToSeconds(new Date(), null); assertThat(areEqual).isFalse(); }
@Test public void areEqualDownToSeconds_should_return_true_for_two_equal_dates() { final Date date = new Date(); boolean areEqual = cut.areEqualDownToSeconds(date, date); assertThat(areEqual).isTrue(); }
@Test public void areEqualDownToSeconds_should_return_true_for_two_dates_separated_by_500_milliseconds() { final Date date1 = new Date(1000); final Date date2 = new Date(1500); boolean areEqual = cut.areEqualDownToSeconds(date1, date2); assertThat(areEqual).isTrue(); }
@Test public void areEqualDownToSeconds_should_return_false_for_two_dates_separated_by_more_than_1000_milliseconds() { final Date date1 = new Date(1000); final Date date2 = new Date(2001); boolean areEqual = cut.areEqualDownToSeconds(date1, date2); assertThat(areEqual).isFalse(); }
@Test public void areEqualDownToSeconds_should_return_false_for_two_dates_separated_by_more_than_1000_milliseconds_in_any_order() { final Date date1 = new Date(2001); final Date date2 = new Date(1000); boolean areEqual = cut.areEqualDownToSeconds(date1, date2); assertThat(areEqual).isFalse(); }