private void findAndCollectConflicts(
            Model model,
            ShapeId trait,
            List<ShapeId> conflicts,
            Map<Shape, Map<ShapeId, List<ShapeId>>> shapeToTraitConflicts
    ) {
        for (Shape shape : model.getShapesWithTrait(trait)) {
            for (ShapeId conflict : conflicts) {
                if (shape.hasTrait(conflict)) {
                    shapeToTraitConflicts
                            .computeIfAbsent(shape, id -> new HashMap<>())
                            .computeIfAbsent(trait, id -> new ArrayList<>())
                            .add(conflict);
                }
            }
        }
    }
Validates that traits do not conflict.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitConflictValidator.java