In this recipe, you used LinkedBlockingDeque, parameterized by the String class, to work with a non-blocking concurrent deque of data.
The Client class uses the put() method to insert strings into the deque. If the deque is full (because you have created it with fixed capacity), the method will block the execution of its thread until there is empty space in the list.
The Main class uses the take() method to get strings from the deque. If the deque is empty, the method blocks the execution of its thread until there are elements in the deque.
Both the methods of the LinkedBlockingDeque class used in this example can throw an InterruptedException exception if they are interrupted while they are being blocked. So, you have to ...