- final BlockingQueue<Runnable> delegate = capacity.isPresent() ? new LinkedBlockingQueue<>(capacity.getAsInt())
- : new LinkedBlockingQueue<>();
- return new ForwardingBlockingQueue(delegate);
+ return new ForwardingBlockingQueue(
+ capacity.isPresent() ? new LinkedBlockingQueue<>(capacity.orElseThrow()) : new LinkedBlockingQueue<>());