private InternalSelector parseAttribute() {
        ws();
        List<String> path = parseAttributePath();
        ws();
        char next = expect(']', '=', '!', '^', '$', '*', '?', '>', '<');

        if (next == ']') {
            return AttributeSelector.existence(path);
        }

        AttributeComparator comparator = parseComparator(next);
        List<String> values = parseAttributeValues();
        boolean insensitive = parseCaseInsensitiveToken();
        expect(']');
        return new AttributeSelector(path, values, comparator, 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