Duration.from(TemporalAmount) will always throw a UnsupportedTemporalTypeException when passed a Period and return itself when passed a Duration.
Suppress false positives by adding the suppression annotation @SuppressWarnings("DurationFrom")
to the enclosing element.