void add(@NotNull T command, @NotNull Predicate<? super T> predicate) {
      synchronized (deque) {
        if (closed) return;
        T old = deque.peekFirst();
        boolean add = old == null || predicate.test(old);
        if (add) deque.addFirst(command);
      }
    }
void add(@NotNull T command, @NotNull Predicate<? super T> predicate)