private boolean matchesSelector(IdRefTrait trait, Shape needle, Context context) {
        if (trait.getSelector().toString().equals("*")) {
            return true;
        } else {
            return context.select(trait.getSelector()).contains(needle);
        }
    }
Validates that the value contained in a string shape is a valid shape ID
and that the shape ID targets a shape that is in the set of shapes
matching the selector.
smithy-model/src/main/java/software/amazon/smithy/model/validation/node/IdRefPlugin.java