[concurrency-interest] LinkedBlockingQueue does not throw ClassCastException

Szabolcs Ferenczi szabolcs.ferenczi at gmail.com
Mon Apr 16 18:57:52 EDT 2007


On 17/04/07, David Holmes <dcholmes at optusnet.com.au> wrote:
> You can't write a test for "optional" behaviour without some way of knowing
> whether the implementation you are testing is trying to support that
> optional behaviour.

Strange. If you cannot test it, how can you use it? If it is so
optional that it can behave any way it likes, what can you use it for?

I was trying to test it according the documentation.
"ClassCastException - if the class of the specified element prevents
it from being added to this queue" I thought, if it is documented, it
could be tested as well. Sorry.

Szabolcs


More information about the Concurrency-interest mailing list