Is there any explanation given to why D is correct?? The only reason that I can think of is that clear method is optional for List implementations. So there's no guarantee that the actual implementation of the list will support the clear method and might throw an UnsupportedOperationException...
Venu is right.
before seacrching a collection it should be sorted otherwise the result will be unpredictable.
read ch-7 K&B it explained there with an example.
There's another reason answer D is correct: a "valid list implementation" may still throw UnsupportedOperationException in response to some methods, such as add() or clear(). Try running this with
First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards