void (boolean isContinueToCollect, @NotNull Consumer<? super ActivityImpl> consumer) { isEnabled = isContinueToCollect; while (true) { ActivityImpl item = items.poll(); if (item == null) { break; } consumer.accept(item); } }