In the Java API documentation, I tried to understand the following explanation from an implementation point of view.
http://docs.oracle.com/javase/6/docs/api/java/util/Queue.html
Besides basic Collection operations, queues provide additional insertion, extraction, and inspection operations. Each of these methods exists in two forms: one throws an exception if the operation fails, the other returns a special value (either null or false, depending on the operation). The latter form of the insert operation is designed specifically for use with capacity-restricted Queue implementations; in most implementations, insert operations cannot fail.
So, I would like to write a program to verify, in which scenario it throws an exception. How can I create a capacity-restricted queue implementation and verify?
Can someone advice with an example?