private void addValidationEventsForShapes(Set<OperationShape> shapes, List<ValidationEvent> events) {
        Map<String, List<Shape>> testCaseIdsToOperations = new HashMap<>();
        for (Shape shape : shapes) {
            if (!shape.isOperationShape() || !shape.hasTrait(SmokeTestsTrait.ID)) {
                continue;
            }

            SmokeTestsTrait trait = shape.expectTrait(SmokeTestsTrait.class);
            for (SmokeTestCase testCase : trait.getTestCases()) {
                testCaseIdsToOperations.computeIfAbsent(testCase.getId(), id -> new ArrayList<>()).add(shape);
            }
        }

        for (Map.Entry<String, List<Shape>> entry : testCaseIdsToOperations.entrySet()) {
            if (entry.getValue().size() > 1) {
                for (Shape shape : entry.getValue()) {
                    events.add(error(shape,
                            String.format(
                                    "Conflicting `%s` test case IDs found for ID `%s`: %s",
                                    SmokeTestsTrait.ID,
                                    entry.getKey(),
                                    ValidationUtils.tickedList(entry.getValue().stream().map(Shape::getId)))));
                }
            }
        }
    }
Validates that smoke test cases have unique IDs within a service closure,
or within the trait if it is not connected to a service.
smithy-smoke-test-traits/src/main/java/software/amazon/smithy/smoketests/traits/UniqueSmokeTestCaseIdValidator.java