@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 testLowercaseAndPosition() {

        final ValidationContext context = TestValidationContext.create("foo:bar and")
                .build();

        final List<ValidationMessage> validation = sut.validate(context);

        assertThat(validation.size()).isEqualTo(1);

        final ValidationMessage message = validation.iterator().next();
        assertThat(message.validationType()).isEqualTo(ValidationType.INVALID_OPERATOR);
        assertThat(message.relatedProperty()).hasValue("and");

        assertThat(message.position()).hasValue(QueryPosition.builder()
                .beginLine(1)
                .beginColumn(8)
                .endLine(1)
                .endColumn(11)
                .build());
    }