@Override
    public List<ValidationMessage> validate(ValidationContext context) {
        return context.query().tokens().stream()
                .filter(this::isInvalidOperator)
                .map(token -> {
                    final String errorMessage = String.format(Locale.ROOT, "Query contains invalid operator \"%s\". All AND / OR / NOT operators have to be written uppercase", token.image());
                    return ValidationMessage.builder(ValidationStatus.WARNING, ValidationType.INVALID_OPERATOR)
                            .errorMessage(errorMessage)
                            .relatedProperty(token.image())
                            .position(QueryPosition.from(token))
                            .build();
                }).collect(Collectors.toList());
    }
@Test
    void testLowercaseNegation() {
        final ValidationContext context = TestValidationContext.create("not(foo:bar)")
                .build();
        final List<ValidationMessage> messages = sut.validate(context);
        assertThat(messages.size()).isEqualTo(1);
        final ValidationMessage message = messages.iterator().next();
        assertThat(message.validationType()).isEqualTo(ValidationType.INVALID_OPERATOR);
        assertThat(message.relatedProperty()).hasValue("not");
    }