What is EvictingQueue ?
EvictingQueue is part of Google’s Guava library.A non-blocking queue which automatically evicts elements from the head of the queue when attempting to add new elements onto the queue and it is full. This data structure is logically equivalent to a circular buffer (i.e., cyclic buffer or ring buffer).
An evicting queue must be configured with a maximum size. Each time an element is added to a full queue, the queue automatically removes its head element. This is different from conventional bounded queues, which either block or reject new elements when full.

Let’s get started on Example

Result

Visit My Repository for full code
showimage
https://github.com/srigalamilitan/PT-GUAVA-GOOGLE






Reference
http://google.github.io/guava/releases/snapshot/api/docs/
http://crunchify.com/arrayblockingqueue-vs-google-guava-non-blocking-evictingqueue-example/