Merge remote-tracking branch 'origin/master'
Merge remote-tracking branch 'origin/master'
Add test case that prove which can be interrupted or which cannot be
interrupted.
From CJP 5.5:
Similarly, you can use a Semaphore to turn any collection into a
blocking bounded collection, as illustrated by BoundedHashSet in Listing
5.14. The semaphore is initialized to the desired maximum size of the
collection. The add operation acquires a permit before adding the item
into the underlying collection. If the underlying add operation does not
actually add anything, it releases the permit immediately. Similarly, a
successful remove operation releases a permit, enabling more elements to
be added. The underlying Set implementation knows nothing about the
bound; this is handled by BoundedHashSet.