private ScopedAttributeSelector.Assertion parseScopedAssertion() {
        ScopedAttributeSelector.ScopedFactory lhs = parseScopedValue();
        char next = peek();
        skip();
        AttributeComparator comparator = parseComparator(next);

        List<ScopedAttributeSelector.ScopedFactory> rhs = new ArrayList<>();
        rhs.add(parseScopedValue());

        while (peek() == ',') {
            skip();
            rhs.add(parseScopedValue());
        }

        boolean insensitive = parseCaseInsensitiveToken();
        return new ScopedAttributeSelector.Assertion(lhs, comparator, rhs, insensitive);
    }
Filter out unnecessary identity selectors when creating the finalized AST to evaluate selectors.
smithy-model/src/main/java/software/amazon/smithy/model/selector/SelectorParser.java