I had to do an implementation of a custom barrier class using locks as part of my course work. To test my LockBarrier class, I came up with a the following test
LockBarrier
The code looks good to me. Maybe you can pass the LockBarrier to the Runnable instead of declaring it outside.