@Override
    public List<ValidationEvent> validate(Model model) {
        return model.shapes(ResourceShape.class)
                .flatMap(shape -> OptionalUtils.stream(detectCycles(model, shape, new LinkedHashSet<>())))
                .collect(Collectors.toList());
    }
Validates that resource references do not introduce circular hierarchies.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceCycleValidator.java