unit test for Semaphore

To simplify this test -> Why don't you initialize the semaphore with 0 permits. Then you can get rid of the semaphore.acquire method call.

The simpler the test, the better. Else you are confusing people.