private static List<String> parseSelectorPath(SimpleParser parser) {
        parser.ws();

        if (parser.peek() != '|') {
            return Collections.emptyList();
        }

        List<String> result = new ArrayList<>();
        do {
            parser.skip(); // skip '|'
            result.add(parseSelectorPathSegment(parser));
        } while (parser.peek() == '|');

        return result;
    }
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