Duration APIs only work for TemporalUnits with exact durations or ChronoUnit.DAYS. E.g., Duration.of(1, ChronoUnit.YEARS) is guaranteed to throw a DateTimeException.
Suppress false positives by adding the suppression annotation @SuppressWarnings("DurationTemporalUnit")
to the enclosing element.