CassandraUtil { @SuppressWarnings("JdkObsolete") static List<Date> getDays(long endTs, @Nullable Long lookback) { List<Date> result = new ArrayList<>(); for (long epochMillis : DateUtil.epochDays(endTs, lookback)) { result.add(new Date(epochMillis)); } return result; }    }
@Test public void getDays_consistentWithDateUtil() { assertThat(CassandraUtil.getDays(DAYS.toMillis(2), DAYS.toMillis(1))) .extracting(Date::getTime) .containsExactlyElementsOf(DateUtil.epochDays(DAYS.toMillis(2), DAYS.toMillis(1))); }