private void compareResult(String path, Node left, Node right) {
            if (!left.isNullNode() || !right.isNullNode()) {
                TraitDefinition.ChangeType type = isChangeBreaking(rule.getChange(), left, right);
                if (type != null) {
                    String message = createBreakingMessage(type, path, left, right);
                    if (rule.getMessage().isPresent()) {
                        if (!message.endsWith(".")) {
                            message = message + "; ";
                        }
                        message = message + rule.getMessage().get();
                    }
                    FromSourceLocation location = !right.isNullNode() ? right : targetShape;
                    events.add(ValidationEvent.builder()
                            .id(getValidationEventId(type))
                            .severity(rule.getDefaultedSeverity())
                            .shape(targetShape)
                            .sourceLocation(location)
                            .message(message)
                            .build());
                }
            }
        }
Finds breaking changes related to when a trait is added, removed, or
updated based on the breakingChanges property of traits.
smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/TraitBreakingChange.java