@SuppressWarnings("unchecked")
    public <T> Optional<T> getProperty(String name, Class<T> type) {
        return getProperty(name)
                .map(value -> {
                    if (!type.isInstance(value)) {
                        throw new IllegalArgumentException(String.format(
                                "%s property `%s` of `%s` is not an instance of `%s`. Found `%s`",
                                getClass().getSimpleName(),
                                name,
                                this,
                                type.getName(),
                                value.getClass().getName()));
                    }
                    return (T) value;
                });
    }
Gets an additional property of a specific type.

@param name Name of the property to get.
@param type Type of value to expect.
@param <T> Type of value to expect.
@return Returns a map of additional property strings.
@throws IllegalArgumentException if the value is not of the given type.
smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/TypedPropertiesBag.java