public boolean hasAsyncCommands() {
    return ConcurrencyUtil.withLock(myLock, () ->
      Arrays.stream(myEvents).flatMap(Collection::stream).anyMatch(c -> !(c instanceof PossiblySyncCommand)));
  }
public boolean hasAsyncCommands()