@Override
    public void onError(QueryException error) {
        assert error != null;
        done.compareAndSet(null, error);
    }
@Test
    @SuppressWarnings("ResultOfMethodCallIgnored")
    public void when_onErrorCalledTwice_then_secondIgnored() {
        initProducer(false);
        producer.onError(QueryException.error("error1"));
        producer.onError(QueryException.error("error2"));

        assertThatThrownBy(iterator::hasNext)
                .hasMessageContaining("error1");
    }