private List<ValidationEvent> validateService(TopDownIndex topDownIndex, ServiceShape service) {
        List<ValidationEvent> events = new ArrayList<>();
        Map<String, List<ShapeId>> resourceMap = new HashMap<>();
        for (ResourceShape resource : topDownIndex.getContainedResources(service)) {
            String resourceName = IamResourceTrait.resolveResourceName(resource).toLowerCase(Locale.US);
            resourceMap.computeIfAbsent(resourceName, k -> new ArrayList<>()).add(resource.getId());
        }
        resourceMap.entrySet()
                .stream()
                .filter(entry -> entry.getValue().size() > 1)
                .map(entry -> error(service,
                        String.format(
                                "Multiple IAM resources defined with the same IAM resource name is not allowed in a "
                                        + "service closure, but found multiple resources case-insensitively named `%s` "
                                        + "in the service `%s`: [%s]",
                                entry.getKey(),
                                service.getId(),
                                tickedList(entry.getValue()))))
                .forEach(events::add);
        return events;
    }
Ensures that there is no resource name conflict in a service closure
in IAM space after processing {@link IamResourceTrait}.
smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/IamResourceTraitConflictingNameValidator.java