unit test for Semaphore

I would get rid of the for loop. It doesn't make the test more understandable. So set the licenses to some number, get the negatve number of licenses within a try/catch block and at the end verify that the number of licenses has not been changed due to illegal call.

And I would add an assert at the end to verify the license count.