@SuppressWarnings("unchecked")
    public static <T> Optional<T> or(Optional<T> value, Supplier<Optional<? extends T>> supplier) {
        return value.isPresent() ? value : (Optional<T>) supplier.get();
    }
Retrieves the value of the optional if present or invokes the supplier
for a value.

@param value Value to check.
@param supplier Supplier for a value if no value is present.
@param <T> Type of value.
@return A value of type T.
smithy-utils/src/main/java/software/amazon/smithy/utils/OptionalUtils.java