private @NotNull Processor<Result> threadSafeProcessor(@NotNull Processor<? super Result> consumer) {
    Object lock = ObjectUtils.sentinel("AbstractQuery lock");
    return e -> {
      synchronized (lock) {
        return consumer.process(e);
      }
    };
  }
private @NotNull Processor<Result> threadSafeProcessor(@NotNull Processor<? super Result> consumer)