@Test public void diffHours_should_work() { final Date date1 = new Date(1000 * 60 * 60 + 1); final Date date2 = new Date(1000 * 60 * 60 * 3 + 2); long hours = cut.diffHours(date1, date2); assertThat(hours).isEqualTo(2); }
long diffHours(Date date1, Date date2) { return Math.abs(date1.getTime() - date2.getTime()) / (1000 * 60 * 60); }
DefectService { long diffHours(Date date1, Date date2) { return Math.abs(date1.getTime() - date2.getTime()) / (1000 * 60 * 60); } }
DefectService { long diffHours(Date date1, Date date2) { return Math.abs(date1.getTime() - date2.getTime()) / (1000 * 60 * 60); }  }
DefectService { long diffHours(Date date1, Date date2) { return Math.abs(date1.getTime() - date2.getTime()) / (1000 * 60 * 60); }  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 { long diffHours(Date date1, Date date2) { return Math.abs(date1.getTime() - date2.getTime()) / (1000 * 60 * 60); }  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);  }