public static TimeUnit toTimeUnit(final ChronoUnit tu) {
        if (tu == null) {
            return null;
        }
        return switch (tu) {
            case DAYS -> TimeUnit.DAYS;
            case HOURS -> TimeUnit.HOURS;
            case MINUTES -> TimeUnit.MINUTES;
            case SECONDS -> TimeUnit.SECONDS;
            case MICROS -> TimeUnit.MICROSECONDS;
            case MILLIS -> TimeUnit.MILLISECONDS;
            case NANOS -> TimeUnit.NANOSECONDS;
            default -> throw new UnsupportedOperationException("Temporal unit is not supported");
        };
    }
To time unit time unit.

@param tu the tu
@return the time unit
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/DateTimeUtils.java