DynamoDBUtils { public static List<String> getISODatesByRange(long epochBegin, long epochEnd) { List<String> datesArray = new ArrayList<>(); while (epochBegin <= epochEnd) { String date = getIso8601FromDate(new Date(epochBegin)); datesArray.add(date); epochBegin += TimeUnit.DAYS.toMillis(1); } return datesArray; }  static String getIso8601FromDate(Date date); static List<String> getISODatesByRange(long epochBegin, long epochEnd);  }
@Test public void testGetUnrefreshedCertDates() { long epoch = 1591706189000L; long beginning = epoch - TimeUnit.HOURS.toMillis(720); long end = epoch - TimeUnit.HOURS.toMillis(72); List<String> unrefreshedCertDates = DynamoDBUtils.getISODatesByRange(beginning, end); assertEquals(28, unrefreshedCertDates.size()); assertTrue(unrefreshedCertDates.contains("2020-05-10")); assertTrue(unrefreshedCertDates.contains("2020-06-06")); assertFalse(unrefreshedCertDates.contains("2020-05-09")); assertFalse(unrefreshedCertDates.contains("2020-06-07")); }