unit test for Semaphore

This is very dangerous because it could be that the other thread has not acquired. So this test can fail from time to time and that is very annoying. Probably you can do it with a regular CountDownLatch.

I would not do repeated things you do here. I would only do it once and if then create some kind of stress test where do stress the system with repeated releases/acquire.Perhaps make the dining philosophers using the ISemaphore.