protected void check(Shape shape, Context context, RangeTrait trait, NumberNode node, Emitter emitter) {
        trait.getMin().ifPresent(min -> {
            node.asBigDecimal().ifPresent(decimal -> {
                if (decimal.compareTo(min) < 0) {
                    emitter.accept(node,
                            getSeverity(node, context),
                            String.format(
                                    "Value provided for `%s` must be greater than or equal to %s, but found %s",
                                    shape.getId(),
                                    min,
                                    decimal),
                            shape.isMemberShape() ? MEMBER : TARGET,
                            INVALID_RANGE);
                }
            });
        });

        trait.getMax().ifPresent(max -> {
            node.asBigDecimal().ifPresent(decimal -> {
                if (decimal.compareTo(max) > 0) {
                    emitter.accept(node,
                            getSeverity(node, context),
                            String.format(
                                    "Value provided for `%s` must be less than or equal to %s, but found %s",
                                    shape.getId(),
                                    max,
                                    decimal),
                            shape.isMemberShape() ? MEMBER : TARGET,
                            INVALID_RANGE);
                }
            });
        });
    }
Validates the range trait on number shapes or members that target them.
smithy-model/src/main/java/software/amazon/smithy/model/validation/node/RangeTraitPlugin.java