@Override
    public List<ValidationEvent> validate(Model model) {
        // Find all trait definitions and collect conflicting traits into a map.
        Map<Shape, Map<ShapeId, List<ShapeId>>> shapeToTraitConflicts = new HashMap<>();
        for (Shape shape : model.getShapesWithTrait(TraitDefinition.class)) {
            TraitDefinition trait = shape.expectTrait(TraitDefinition.class);
            // Only look at trait definitions that define conflicting traits.
            if (!trait.getConflicts().isEmpty()) {
                findAndCollectConflicts(model, shape.getId(), trait.getConflicts(), shapeToTraitConflicts);
            }
        }

        if (shapeToTraitConflicts.isEmpty()) {
            return Collections.emptyList();
        }

        List<ValidationEvent> events = new ArrayList<>();
        for (Map.Entry<Shape, Map<ShapeId, List<ShapeId>>> entry : shapeToTraitConflicts.entrySet()) {
            events.add(emitForConflicts(entry.getKey(), entry.getValue()));
        }

        return events;
    }
Validates that traits do not conflict.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitConflictValidator.java