@Test
public void listenerTest() {

    FEELEvent syntaxErrorEvent = new SyntaxErrorEvent(Severity.ERROR, "test", null, 0, 0, null);
    FEELEvent genericError = new FEELEventBase(Severity.ERROR, "error", null);
    FEELEvent notError = new FEELEventBase(Severity.INFO, "info", null);
    AtomicReference<FEELEvent> error = new AtomicReference<>();
    FEEL feel = expressionEvaluator.newFeelEvaluator(error);
    // Only a single error of type syntax
    applyEvents(Collections.singletonList(syntaxErrorEvent), feel);
    assertEquals(syntaxErrorEvent, error.get());
    error.set(null);
    // Syntax error as second
    applyEvents(Arrays.asList(genericError, syntaxErrorEvent), feel);
    assertEquals(syntaxErrorEvent, error.get());
    error.set(null);
    // Syntax error as first
    applyEvents(Arrays.asList(syntaxErrorEvent, genericError), feel);
    assertEquals(syntaxErrorEvent, error.get());
    error.set(null);
    // Not error
    applyEvents(Collections.singletonList(notError), feel);
    assertNull(error.get());
}