private List<ValidationEvent> validateRangeTrait(Model model, Shape shape, RangeTrait trait) {
        List<ValidationEvent> events = new ArrayList<>();
        trait.getMin()
                .flatMap(min -> validateRangeProperty(model, shape, trait, min, "min"))
                .ifPresent(events::add);

        trait.getMax()
                .flatMap(max -> validateRangeProperty(model, shape, trait, max, "max"))
                .ifPresent(events::add);

        // Makes sure that `min` is less than `max`
        trait.getMin()
                .flatMap(min -> trait.getMax().map(max -> Pair.of(min, max)))
                .filter(pair -> pair.getLeft().compareTo(pair.getRight()) > 0)
                .map(pair -> error(shape,
                        trait,
                        "A range trait is applied with a `min` value greater than "
                                + "its `max` value."))
                .map(events::add);

        return events;
    }
Ensures that range traits are valid.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/RangeTraitValidator.java