@Override
    @NonNull
    public Predicate<E> convert(SelectorCriteria criteria) {
        return ext -> {
            var labels = ext.getMetadata().getLabels();
            switch (criteria.operator()) {
                case Equals -> {
                    if (labels == null || !labels.containsKey(criteria.key())) {
                        return false;
                    }
                    return criteria.values().contains(labels.get(criteria.key()));
                }
                case NotEquals -> {
                    if (labels == null || !labels.containsKey(criteria.key())) {
                        return false;
                    }
                    return !criteria.values().contains(labels.get(criteria.key()));
                }
                case NotExist -> {
                    return labels == null || !labels.containsKey(criteria.key());
                }
                case Exist -> {
                    return labels != null && labels.containsKey(criteria.key());
                }
                default -> {
                    return false;
                }
            }
        };
    }
@Test
    void shouldConvertNotEqualsCorrectly() {
        var criteria = new SelectorCriteria("name", Operator.NotEquals, Set.of("value1", "value2"));
        var predicate = convert.convert(criteria);
        assertNotNull(predicate);

        var fakeExt = new FakeExtension();
        var metadata = new Metadata();
        fakeExt.setMetadata(metadata);
        assertFalse(predicate.test(fakeExt));

        metadata.setLabels(Map.of("name", "value"));
        assertTrue(predicate.test(fakeExt));

        metadata.setLabels(Map.of("name", "value1"));
        assertFalse(predicate.test(fakeExt));

        metadata.setLabels(Map.of("name", "value2"));
        assertFalse(predicate.test(fakeExt));
    }