@Test public void areEqualDownToSeconds_should_return_false_for_first_date_null() { boolean areEqual = cut.areEqualDownToSeconds(null, new Date()); assertThat(areEqual).isFalse(); }
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)); }
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)); } }
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)); }  }
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); }
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);  }