@Override
    public List<ValidationEvent> validate(Model model) {
        List<ValidationEvent> events = new ArrayList<>();
        Set<ServiceShape> serviceShapes = model.getServiceShapes();
        Set<OperationShape> serviceBoundOperations = new HashSet<>();
        TopDownIndex index = new TopDownIndex(model);
        // Validate test case ids within each service closure
        for (ServiceShape service : serviceShapes) {
            Set<OperationShape> boundOperations = index.getContainedOperations(service);
            addValidationEventsForShapes(boundOperations, events);
            serviceBoundOperations.addAll(boundOperations);
        }

        // Also validate ids are unique within each non-service bound operation
        List<OperationShape> shapes = model.getOperationShapesWithTrait(SmokeTestsTrait.class)
                .stream()
                .filter(shape -> !serviceBoundOperations.contains(shape))
                .collect(Collectors.toList());

        for (OperationShape shape : shapes) {
            addValidationEventsForShapes(SetUtils.of(shape), events);
        }
        return events;
    }
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