pollFirst
pollFirst is a method in the Java standard library’s Deque interface. It retrieves and removes the first element of the deque, or returns null if the deque is empty. The operation is non-blocking and does not throw an exception when the deque is empty.
In terms of behavior, pollFirst returns the element at the front of the deque and removes it.
pollFirst is effectively the Deque-specific equivalent of poll() when used through the Deque interface, both of
Common usage involves non-blocking queue operations in single- or multi-threaded contexts. For example, a producer-consumer setup